From 7d974e6b893aaee606a9ec911ae7212f90fe4509 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sat, 15 May 2021 03:06:57 +0200 Subject: [PATCH] Patched notifications to handle empty result. --- assets/js/ui/actions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assets/js/ui/actions.js b/assets/js/ui/actions.js index 0864e822..90b348f4 100644 --- a/assets/js/ui/actions.js +++ b/assets/js/ui/actions.js @@ -95,6 +95,14 @@ function initUiActions(store, _router) { offset: (page - 1) * limit, }); + if (!notifications) { + return { + notifications: [], + totalCount: 0, + unseenCount: 0, + }; + } + const curatedNotifications = notifications.nodes.map(notification => curateNotification(notification)); return {