Skip to content

Commit 0f0ce6c

Browse files
committed
Expect boolean value for visibility setting
1 parent 5d0c659 commit 0f0ce6c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

publication/lib/field_publication_web/live/presentation/components/document_view_map.ex

+3-4
Original file line numberDiff line numberDiff line change
@@ -362,17 +362,16 @@ defmodule FieldPublicationWeb.Presentation.Components.DocumentViewMap do
362362
"visibility-set",
363363
%{"group" => group, "uuid" => uuid, "value" => value},
364364
socket
365-
) do
366-
visible? = if value == "true", do: true, else: false
367-
365+
)
366+
when is_boolean(value) do
368367
set_group =
369368
if group == "project", do: :project_tile_layers_state, else: :document_tile_layers_state
370369

371370
layer_states =
372371
socket.assigns[set_group]
373372
|> Enum.map(fn state ->
374373
if state.uuid == uuid do
375-
Map.put(state, :visible, visible?)
374+
Map.put(state, :visible, value)
376375
else
377376
state
378377
end

0 commit comments

Comments
 (0)