Skip to content

Commit bd82703

Browse files
committed
Redirect after changing locale
1 parent d709d4e commit bd82703

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/live_admin/components/container.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ defmodule LiveAdmin.Components.Container do
55
import LiveAdmin,
66
only: [
77
resource_title: 2,
8+
route_with_params: 1,
89
route_with_params: 2,
910
trans: 1
1011
]
@@ -90,7 +91,12 @@ defmodule LiveAdmin.Components.Container do
9091

9192
LiveAdmin.session_store().persist!(new_session)
9293

93-
{:noreply, assign(socket, :session, new_session)}
94+
socket =
95+
socket
96+
|> assign(:session, new_session)
97+
|> push_navigate(to: route_with_params(socket.assigns))
98+
99+
{:noreply, socket}
94100
end
95101

96102
def render(assigns = %{loading: true}), do: ~H""

0 commit comments

Comments
 (0)