From edf6ad9eda323f6e04823b8c110d21d82d519d32 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 28 Jan 2018 19:35:01 +0100 Subject: do not always look first in chache when receiving the *open* status from cache --- view/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 35f723a58..02b0f125c 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -75,8 +75,6 @@ $(document).ready(function() { else { sessionStorage.removeItem('notification_open'); } - - $(this).data('clicked', true); }); if(sessionStorage.getItem('notification_open') !== null) { @@ -938,9 +936,11 @@ function loadNotificationItems(notifyType) { var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : ''); var clicked = $('[data-type=\'' + notifyType + '\']').data('clicked'); + if((clicked === undefined) && (sessionStorage.getItem(notifyType + '_notifications_cache') !== null)) { var cached_data = JSON.parse(sessionStorage.getItem(notifyType + '_notifications_cache')); handleNotificationsItems(notifyType, cached_data); + $('[data-type=\'' + notifyType + '\']').data('clicked',true); console.log('updating ' + notifyType + ' notifications from cache...'); } else { -- cgit v1.2.3