Skip to content

Commit

Permalink
Merge pull request #675 from near/notification_cleanup
Browse files Browse the repository at this point in the history
fix notification state exception
  • Loading branch information
charleslavon authored Oct 6, 2023
2 parents 7df99f5 + b574eb7 commit 6623e95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const showNotificationModal = () => {
return false;
}

const state = getNotificationLocalStorage();
const state = getNotificationLocalStorage() || {};

if ((isLocalStorageSupported() && !state.showOnTS) || state.showOnTS < Date.now()) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/notificationsLocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,6 @@ export const getNotificationLocalStorage = () => {

const accountIdLS = getLSAccountId();

const notificationsLS = isLocalStorageSupported() && JSON.parse(localStorage.getItem(NOTIFICATIONS_STORAGE) || '{}');
const notificationsLS = JSON.parse(localStorage.getItem(NOTIFICATIONS_STORAGE) || '{}');
return notificationsLS[accountIdLS];
};

0 comments on commit 6623e95

Please sign in to comment.