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:
parent
97bd93ed5c
commit
8cbce9565d
2 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue