From 0aa54b8f3e83a887216882e44a934f3e402587e5 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Sat, 3 May 2025 21:40:42 +0300 Subject: [PATCH] Update the error htmls to check if the flash exists. --- .../controllers/error_html/404.html.heex | 4 +++- .../controllers/error_html/500.html.heex | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/decentralised_book_index_web/controllers/error_html/404.html.heex b/lib/decentralised_book_index_web/controllers/error_html/404.html.heex index cf78bfc..41113fe 100644 --- a/lib/decentralised_book_index_web/controllers/error_html/404.html.heex +++ b/lib/decentralised_book_index_web/controllers/error_html/404.html.heex @@ -18,7 +18,9 @@
- <.flash_group flash={@flash} /> + <%= if Map.has_key?(assigns, :flash) do %> + <.flash_group flash={@flash} /> + <% end %>
diff --git a/lib/decentralised_book_index_web/controllers/error_html/500.html.heex b/lib/decentralised_book_index_web/controllers/error_html/500.html.heex index cac21b2..42f8185 100644 --- a/lib/decentralised_book_index_web/controllers/error_html/500.html.heex +++ b/lib/decentralised_book_index_web/controllers/error_html/500.html.heex @@ -18,7 +18,9 @@
- <.flash_group flash={@flash} /> + <%= if Map.has_key?(assigns, :flash) do %> + <.flash_group flash={@flash} /> + <% end %>