Add SetUnreadNotifications action
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2021-03-08 08:45:13 +01:00
parent eb46b3496a
commit f8a0e1e167
2 changed files with 15 additions and 1 deletions

View File

@ -76,6 +76,8 @@ export const OFFLINE = '[AppCommon] Offline';
export const SETPAGEMODE = '[AppCommon] SetPageMode';
export const SETUNREADNOTIFICATIONS = '[AppCommon] SetUnreadNotifications';
export class InitUser implements Action {
readonly type = INITUSER;
@ -339,6 +341,13 @@ export class SetPageMode implements Action {
constructor(public pageMode:boolean) {}
}
export class SetUnreadNotifications implements Action {
readonly type = SETUNREADNOTIFICATIONS;
constructor(public unread:number) {}
}
export type Actions = OpenModal
| InitRoot
@ -382,6 +391,7 @@ export type Actions = OpenModal
| ToggleAppMenu
| ToggleNotificationMenu
| ToggleHelpMenu
| NotificationEvent;
| NotificationEvent
| SetUnreadNotifications;

View File

@ -164,6 +164,10 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
}
return tassign(state,{unreadNotifications:unread});
}
case appCommonActions.SETUNREADNOTIFICATIONS: {
let a = action as appCommonActions.SetUnreadNotifications;
return tassign(state,{unreadNotifications:a.unread});
}
default: {
return state;
}