Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (action.payload.type === MessageType.RECEIVED && scene === 'conversation' && sceneId == action.payload.cid)
yield put({type: MESSAGE_READ, payload: action.payload.cid})
}
// Get and count the number of unread conversations and bells
const conversations = yield select(state => state.conversations)
, unreadConversations = countUnread(conversations)
, bells = yield select(state => state.bells)
, unreadBells = bells.reduce((sum, bell: Bell) => sum + (bell.isRead ? 0 : 1), 0)
, unread = unreadConversations + unreadBells
// Set the badge count depending on the relevant bridge
yield call(
Platform.OS === 'ios' ?
PushNotificationIOS.setApplicationIconBadgeNumber :
AndroidBadge.setBadge,
unread
)
}
}