Centralize role preloading in global LiveView on_mount
Add ensure_user_role_loaded to global live_view quote block. Remove redundant on_mount calls from individual LiveViews.
This commit is contained in:
parent
797452a76e
commit
47c938cc50
12 changed files with 2 additions and 18 deletions
|
|
@ -52,7 +52,8 @@ defmodule MvWeb do
|
|||
quote do
|
||||
use Phoenix.LiveView
|
||||
|
||||
on_mount MvWeb.LiveHelpers
|
||||
on_mount {MvWeb.LiveHelpers, :default}
|
||||
on_mount {MvWeb.LiveHelpers, :ensure_user_role_loaded}
|
||||
|
||||
unquote(html_helpers())
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue