Skip to content

Commit

Permalink
[C-2369] Fix issue where notification poll can break app on signout (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjeffers committed Mar 23, 2023
1 parent 90122d9 commit 38d43c4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
accountSelectors,
Notification,
notificationsActions,
notificationsSelectors,
Expand All @@ -15,6 +16,7 @@ const { updateNotifications } = notificationsActions
const { makeGetAllNotifications } = notificationsSelectors
const getAllNotifications = makeGetAllNotifications()
const { getBalance } = walletActions
const { getHasAccount } = accountSelectors

// Notifications have changed if some of the incoming ones have
// different ids or changed length in unique entities/users
Expand Down Expand Up @@ -62,6 +64,9 @@ export function* handleNewNotifications(notifications: Notification[]) {
}

export function* checkForNewNotificationsSaga() {
const hasAccount = yield* select(getHasAccount)
if (!hasAccount) return

const limit = NOTIFICATION_LIMIT_DEFAULT

const notificationsResponse = yield* call(fetchNotifications, {
Expand Down

0 comments on commit 38d43c4

Please sign in to comment.