function notifications()

in js/reducers/notifications.js [67:97]


function notifications(state: State = initialState, action: Action): State {
  switch (action.type) {
    case "LOADED_NOTIFICATIONS":
      let list = action.list.map(fromParseObject);
      return { ...state, server: list };

    case "RECEIVED_PUSH_NOTIFICATION":
      return { ...state, push: append(action.notification, state.push) };

    case "LOGGED_OUT":
      return { ...state, push: [] };

    case "TURNED_ON_PUSH_NOTIFICATIONS":
      return { ...state, enabled: true };

    case "SKIPPED_PUSH_NOTIFICATIONS":
      return { ...state, enabled: false };

    case "REGISTERED_PUSH_NOTIFICATIONS":
      return { ...state, registered: true };

    case "RESET_NUXES":
      return { ...state, enabled: initialState.enabled };

    case "SEEN_ALL_NOTIFICATIONS":
      return { ...state, seen: fetchAllIds([...state.server, ...state.push]) };

    default:
      return state;
  }
}