Changeset View
Changeset View
Standalone View
Standalone View
lib/reducers/notif-permission-alert-info-reducer.js
- This file was added.
// @flow | |||||
import type { BaseAction } from '../types/redux-types'; | |||||
import { | |||||
type NotifPermissionAlertInfo, | |||||
recordNotifPermissionAlertActionType, | |||||
} from '../utils/push-alerts.js'; | |||||
function reduceNotifPermissionAlertInfo( | |||||
state: NotifPermissionAlertInfo, | |||||
action: BaseAction, | |||||
): NotifPermissionAlertInfo { | |||||
if (action.type === recordNotifPermissionAlertActionType) { | |||||
return { | |||||
totalAlerts: state.totalAlerts + 1, | |||||
lastAlertTime: action.payload.time, | |||||
}; | |||||
} | |||||
return state; | |||||
} | |||||
export { reduceNotifPermissionAlertInfo }; |