Fix Leaflet hook registration and full-page map

Move PropagationMap hook from colocated .hooks.js to assets/js and
register it directly in app.js hooks config. Fixes "unknown hook"
error at runtime.
This commit is contained in:
Graham McIntire 2026-03-30 17:29:05 -05:00
parent 97bd93ed5c
commit 8cbce9565d
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 3 additions and 1 deletions

View file

@ -29,11 +29,13 @@ import {LiveSocket} from "phoenix_live_view"
import {hooks as colocatedHooks} from "phoenix-colocated/microwaveprop"
import topbar from "../vendor/topbar"
import {PropagationMap} from "./propagation_map_hook"
const csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
const liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500,
params: {_csrf_token: csrfToken},
hooks: {...colocatedHooks},
hooks: {...colocatedHooks, PropagationMap},
})
// Show progress bar on live navigation and form submits