Skip to content

Commit c03777d

Browse files
authored
Only show either #client-error or #server-error, not both (#6674)
1 parent ba3a131 commit c03777d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

installer/templates/phx_web/components/layouts.ex.eex

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ defmodule <%= @web_namespace %>.Layouts do
9292
id="client-error"
9393
kind={:error}
9494
title=<%= maybe_heex_attr_gettext.("We can't find the internet", @gettext) %>
95-
phx-disconnected={show(".phx-client-error #client-error") |> JS.remove_attribute("hidden")}
95+
phx-disconnected={
96+
show(".phx-client-error #client-error")
97+
|> JS.remove_attribute("hidden", to: ".phx-client-error #client-error")
98+
}
9699
phx-connected={hide("#client-error") |> JS.set_attribute({"hidden", ""})}
97100
hidden
98101
>
@@ -104,7 +107,10 @@ defmodule <%= @web_namespace %>.Layouts do
104107
id="server-error"
105108
kind={:error}
106109
title=<%= maybe_heex_attr_gettext.("Something went wrong!", @gettext) %>
107-
phx-disconnected={show(".phx-server-error #server-error") |> JS.remove_attribute("hidden")}
110+
phx-disconnected={
111+
show(".phx-server-error #server-error")
112+
|> JS.remove_attribute("hidden", to: ".phx-server-error #server-error")
113+
}
108114
phx-connected={hide("#server-error") |> JS.set_attribute({"hidden", ""})}
109115
hidden
110116
>

0 commit comments

Comments
 (0)