From 560dd083ff43dde80b7339feebab0b3148356d5f Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 30 Oct 2024 15:12:12 +0000 Subject: [PATCH] Update rewards-updated-notification.ts --- .../useCases/common/rewards-updated-notification.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wallet-mobile/src/features/Notifications/useCases/common/rewards-updated-notification.ts b/apps/wallet-mobile/src/features/Notifications/useCases/common/rewards-updated-notification.ts index 76f881b087..5e71cb6a03 100644 --- a/apps/wallet-mobile/src/features/Notifications/useCases/common/rewards-updated-notification.ts +++ b/apps/wallet-mobile/src/features/Notifications/useCases/common/rewards-updated-notification.ts @@ -44,9 +44,11 @@ const buildNotifications = async (appStorage: App.Storage) => { for (const walletId of walletIds) { const wallet = walletManager.getWalletById(walletId) if (!wallet) continue + const storage = buildProcessedNotificationsStorage(appStorage.join(`wallet/${walletId}/${storageKey}/`)) const stakingInfo = await wallet.getStakingInfo() if (stakingInfo.status !== 'staked') continue + const {rewards} = stakingInfo if (await storage.isEmpty()) { @@ -55,9 +57,7 @@ const buildNotifications = async (appStorage: App.Storage) => { const [latestReward] = await storage.getValues() - if (latestReward === rewards) { - continue - } + if (latestReward === rewards) continue await storage.setValues([rewards]) notifications.push(createRewardsUpdatedNotification())