File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
lib/safira_web/live/app/profile_live Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -24,4 +24,12 @@ defmodule SafiraWeb.App.ProfileLive.Index do
2424 socket
2525 |> assign ( :page_title , "Edit Profile" )
2626 end
27+
28+ defp return_path ( user ) do
29+ case user . type do
30+ :attendee -> "app"
31+ :staff -> "dashboard"
32+ _ -> "app"
33+ end
34+ end
2735end
Original file line number Diff line number Diff line change 66 </: actions >
77</ . page >
88
9- < . modal :if = { @ live_action in [ :edit ] } id = "profile-modal " show on_cancel = { JS . patch ( ~p" /" ) } >
9+ < . modal
10+ :if = { @ live_action in [ :edit ] }
11+ id = "profile_settings-modal "
12+ show
13+ on_cancel = { JS . patch ( ~p" /#{ return_path ( @ current_user ) } " ) }
14+ >
1015 < . live_component
1116 module = { SafiraWeb.App.ProfileLive.FormComponent }
1217 id = "profile "
1318 current_user = { @ current_user }
1419 action = { @ live_action }
15- patch = { ~p" /" }
20+ patch = { ~p" /#{ return_path ( @ current_user ) } " }
1621 page_title = { @ page_title }
1722 />
1823</ . modal >
You can’t perform that action at this time.
0 commit comments