prevent TypeError when viewedSafe is undefined

This commit is contained in:
fernandomg 2020-07-15 19:17:40 -03:00
parent 67c67f4569
commit 4634041467
1 changed files with 1 additions and 1 deletions

View File

@ -105,7 +105,7 @@ const notificationsMiddleware = (store) => (next) => async (action) => {
action.payload.forEach((incomingTransactions, safeAddress) => {
const { latestIncomingTxBlock } = state.safes.get('safes').get(safeAddress)
const viewedSafes = state.currentSession ? state.currentSession.get('viewedSafes') : []
const recurringUser = viewedSafes.includes(safeAddress)
const recurringUser = viewedSafes?.includes(safeAddress)
const newIncomingTransactions = incomingTransactions.filter((tx) => tx.blockNumber > latestIncomingTxBlock)