From c7a3281a73839590bfa9d8a9e73c41fc35fc2847 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 22 Dec 2023 11:03:32 +0100 Subject: Fix notifications (#5959) The notification about wrong login was not working. Noticed while working on https://github.com/FreshRSS/FreshRSS/pull/5955 This was due to timing of when the notification is retrieved. Simplified code to make the logic easier and more robust. --- app/layout/layout.phtml | 8 ++++---- app/layout/simple.phtml | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'app/layout') diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index adbd52327..ba6dc4a96 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -77,10 +77,10 @@ if (_t('gen.dir') === 'rtl') { notification)) { - $msg = $this->notification['content']; - $status = $this->notification['type']; - + $notif = Minz_Request::getNotification(); + if (!empty($notif)) { + $msg = $notif['content']; + $status = $notif['type']; invalidateHttpCache(); } ?> diff --git a/app/layout/simple.phtml b/app/layout/simple.phtml index f2e6bbd25..065b69fb9 100644 --- a/app/layout/simple.phtml +++ b/app/layout/simple.phtml @@ -59,9 +59,10 @@ notification)) { - $msg = $this->notification['content']; - $status = $this->notification['type']; + $notif = Minz_Request::getNotification(); + if (!empty($notif)) { + $msg = $notif['content']; + $status = $notif['type']; invalidateHttpCache(); } ?> -- cgit v1.2.3