fix(Map): Fix 'Allow only tracked characters' saving

This commit is contained in:
Dmitry Popov
2025-01-02 18:22:32 +01:00
parent 2a825f5a02
commit 25dd6de770
2 changed files with 12 additions and 2 deletions

View File

@@ -393,6 +393,7 @@ defmodule WandererAppWeb.CoreComponents do
data-pc-name="checkbox"
data-pc-section="root"
>
<input type="hidden" name={@name} value="false" disabled={@rest[:disabled]} />
<input
id={@id}
name={@name}

View File

@@ -203,7 +203,10 @@ defmodule WandererAppWeb.MapsLive do
socket.assigns.form,
form
|> Map.put("acls", form["acls"] || [])
|> Map.put("only_tracked_characters", form["only_tracked_characters"] || false)
|> Map.put(
"only_tracked_characters",
(form["only_tracked_characters"] || "false") |> String.to_existing_atom()
)
)
{:noreply, socket |> assign(form: form)}
@@ -593,7 +596,13 @@ defmodule WandererAppWeb.MapsLive do
scope -> scope
end
form = form |> Map.put("scope", scope)
form =
form
|> Map.put("scope", scope)
|> Map.put(
"only_tracked_characters",
(form["only_tracked_characters"] || "false") |> String.to_existing_atom()
)
map
|> WandererApp.Api.Map.update(form)