Skip to content

Commit

Permalink
Update rewards-updated-notification.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Oct 30, 2024
1 parent 9b146e3 commit 560dd08
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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())
Expand Down

0 comments on commit 560dd08

Please sign in to comment.