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
fb5f4990b8
commit
3852c93ac9
12 changed files with 2 additions and 18 deletions
|
|
@ -24,8 +24,6 @@ defmodule MvWeb.RoleLive.Index do
|
|||
import MvWeb.RoleLive.Helpers,
|
||||
only: [format_error: 1, permission_set_badge_class: 1, opts_with_actor: 3]
|
||||
|
||||
on_mount {MvWeb.LiveHelpers, :ensure_user_role_loaded}
|
||||
|
||||
@impl true
|
||||
def mount(_params, _session, socket) do
|
||||
actor = socket.assigns[:current_user]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue