mirror of
https://github.com/ash-project/ash_hq.git
synced 2024-09-20 21:33:10 +12:00
11 lines
361 B
Elixir
11 lines
361 B
Elixir
defmodule AshHqWeb.InitAssigns do
|
|
@moduledoc "Sets the platform being used with liveview"
|
|
import Phoenix.LiveView
|
|
|
|
def on_mount(:default, _params, _session, socket) do
|
|
case get_connect_params(socket) do
|
|
%{"_platform" => "ios"} -> {:cont, socket |> assign(:platform, :ios)}
|
|
_ -> {:cont, socket |> assign(:platform, :web)}
|
|
end
|
|
end
|
|
end
|