From 11b98583b17bba11eb12608c325caae5d630d992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 18 Mar 2026 08:48:46 -0400 Subject: [PATCH] check triggerEl in callbacks --- public/src/modules/notifications.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 599644848e..1e68cb724a 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -48,9 +48,8 @@ define('notifications', [ ev.stopPropagation(); ev.preventDefault(); } - if (triggerEl) { - triggerEl.dropdown('toggle'); - } + + triggerEl?.dropdown('toggle'); const unread = notifEl.hasClass('unread'); if (!unread) { @@ -61,10 +60,10 @@ define('notifications', [ }); components.get('notifications').on('click', '.mark-all-read', () => { Notifications.markAllRead(); - triggerEl.dropdown('toggle'); + triggerEl?.dropdown('toggle'); }); components.get('notifications').on('click', `[href="${config.relative_path}/notifications"]`, () => { - triggerEl.dropdown('toggle'); + triggerEl?.dropdown('toggle'); }); Notifications.handleUnreadButton(notifList);