From 3bef9a44035aa72bee906e7e7e616e1ed1f2abec Mon Sep 17 00:00:00 2001 From: nwittstruck Date: Fri, 26 Jan 2024 10:50:44 +0100 Subject: [PATCH] bug: fix flash alerts after phoenix 1.7 upgrade --- lib/mindwendel_web.ex | 2 +- .../templates/layout/app.html.heex | 8 ++++++-- .../templates/layout/live.html.heex | 18 ++++++++++-------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/mindwendel_web.ex b/lib/mindwendel_web.ex index 25b289f2..b909db54 100644 --- a/lib/mindwendel_web.ex +++ b/lib/mindwendel_web.ex @@ -35,7 +35,7 @@ defmodule MindwendelWeb do # Import convenience functions from controllers import Phoenix.Controller, - only: [get_flash: 1, get_flash: 2, view_module: 1, view_template: 1] + only: [view_module: 1, view_template: 1] # Include shared imports and aliases for views unquote(view_helpers()) diff --git a/lib/mindwendel_web/templates/layout/app.html.heex b/lib/mindwendel_web/templates/layout/app.html.heex index 3465d98d..09a7cb42 100644 --- a/lib/mindwendel_web/templates/layout/app.html.heex +++ b/lib/mindwendel_web/templates/layout/app.html.heex @@ -1,5 +1,9 @@
- - + <%= if Phoenix.Flash.get(@flash, :info) do %> + + <% end %> + <%= if Phoenix.Flash.get(@flash, :error) do %> + + <% end %> <%= @inner_content %>
diff --git a/lib/mindwendel_web/templates/layout/live.html.heex b/lib/mindwendel_web/templates/layout/live.html.heex index 9f2e10ba..fb2878cb 100644 --- a/lib/mindwendel_web/templates/layout/live.html.heex +++ b/lib/mindwendel_web/templates/layout/live.html.heex @@ -1,11 +1,13 @@
- - - - + <%= if live_flash(@flash, :info) do %> + + <% end %> + <%= if live_flash(@flash, :error) do %> + + <% end %> <%= @inner_content %>