Skip to content

Commit deb95d8

Browse files
committed
Fix and move test env switch inside the modal component
1 parent f90e8d3 commit deb95d8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/plausible_web/live/components/modal.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ defmodule PlausibleWeb.Live.Components.Modal do
131131

132132
@impl true
133133
def update(assigns, socket) do
134-
preload? = Map.get(assigns, :preload?, true)
134+
preload? =
135+
if Mix.env() in [:test, :ce_test] do
136+
true
137+
else
138+
Map.get(assigns, :preload?, true)
139+
end
135140

136141
socket =
137142
assign(socket,

lib/plausible_web/live/goal_settings.ex

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ defmodule PlausibleWeb.Live.GoalSettings do
5151
<div id="goal-settings-main">
5252
<.flash_messages flash={@flash} />
5353
54-
<.live_component
55-
:let={modal_unique_id}
56-
module={Modal}
57-
preload?={Mix.env() == :test}
58-
id="goals-form-modal"
59-
>
54+
<.live_component :let={modal_unique_id} module={Modal} preload?={false} id="goals-form-modal">
6055
<.live_component
6156
module={PlausibleWeb.Live.GoalSettings.Form}
6257
id={"goals-form-#{modal_unique_id}"}

0 commit comments

Comments
 (0)