More work with fire notifications

This commit is contained in:
Vicente J. Ruiz Jurado 2018-07-31 12:51:10 +02:00
parent 5fdaf239c0
commit 9dd8a7de97
24 changed files with 512 additions and 288 deletions

View file

@ -6,7 +6,16 @@ AppState appReducer(AppState state, action) {
return state.copyWith(yourLocations: action.fetchedYourLocations);
}
if (action is FetchFireNotificationsSucceededAction) {
return state.copyWith(fireNotifications: action.fetchedFireNotifications);
return state.copyWith(fireNotifications: action.fetchedFireNotifications,
fireNotificationsUnread: action.unreadCount);
}
if (action is AddedFireNotificationAction)
return state.copyWith(
fireNotificationsUnread: state.fireNotificationsUnread + 1);
if (action is ReadedFireNotificationAction)
return state.copyWith(
fireNotificationsUnread: state.fireNotificationsUnread - 1);
return state;
}
}