Display static changed banner instead of toast
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
<div
|
||||
:if={assigns[:static_changed]}
|
||||
class="bg-yellow-100 dark:bg-yellow-900 border-b border-yellow-300 dark:border-yellow-700 px-4 py-2 text-center text-sm text-yellow-700 dark:text-yellow-200"
|
||||
>
|
||||
{gettext("The application has been updated.")}
|
||||
<a href="" onclick="window.location.reload()" class="underline font-medium">
|
||||
{gettext("Reload")}
|
||||
</a>
|
||||
</div>
|
||||
<nav class="border-b border-slate-900/10 dark:border-slate-300/10" aria-label="Sections">
|
||||
<div class="mx-auto max-w-screen-2xl px-4 sm:px-6 lg:px-8 2xl:px-0">
|
||||
<div class="flex h-16 justify-between">
|
||||
|
||||
@@ -2,13 +2,6 @@ defmodule MusicLibraryWeb.Hooks.StaticAssets do
|
||||
use MusicLibraryWeb, :live_component
|
||||
|
||||
def on_mount(:default, _params, _session, socket) do
|
||||
socket =
|
||||
if static_changed?(socket) do
|
||||
put_toast(socket, :warning, gettext("The application has been updated, please reload."))
|
||||
else
|
||||
socket
|
||||
end
|
||||
|
||||
{:cont, socket}
|
||||
{:cont, assign(socket, :static_changed, static_changed?(socket))}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -198,11 +198,6 @@ msgstr ""
|
||||
msgid "Stats"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/hooks/static_assets.ex
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "The application has been updated, please reload."
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/components/record_form.ex
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Type"
|
||||
@@ -2023,3 +2018,13 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Errors"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/components/layouts/app.html.heex
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Reload"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/components/layouts/app.html.heex
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "The application has been updated."
|
||||
msgstr ""
|
||||
|
||||
@@ -198,11 +198,6 @@ msgstr ""
|
||||
msgid "Stats"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/hooks/static_assets.ex
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "The application has been updated, please reload."
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/components/record_form.ex
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Type"
|
||||
@@ -2023,3 +2018,13 @@ msgstr ""
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "Errors"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/components/layouts/app.html.heex
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "Reload"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/components/layouts/app.html.heex
|
||||
#, elixir-autogen, elixir-format, fuzzy
|
||||
msgid "The application has been updated."
|
||||
msgstr ""
|
||||
|
||||
Reference in New Issue
Block a user