Add SetUnreadNotifications action
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
eb46b3496a
commit
f8a0e1e167
@ -76,6 +76,8 @@ export const OFFLINE = '[AppCommon] Offline';
|
|||||||
|
|
||||||
export const SETPAGEMODE = '[AppCommon] SetPageMode';
|
export const SETPAGEMODE = '[AppCommon] SetPageMode';
|
||||||
|
|
||||||
|
export const SETUNREADNOTIFICATIONS = '[AppCommon] SetUnreadNotifications';
|
||||||
|
|
||||||
export class InitUser implements Action {
|
export class InitUser implements Action {
|
||||||
readonly type = INITUSER;
|
readonly type = INITUSER;
|
||||||
|
|
||||||
@ -339,6 +341,13 @@ export class SetPageMode implements Action {
|
|||||||
constructor(public pageMode:boolean) {}
|
constructor(public pageMode:boolean) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SetUnreadNotifications implements Action {
|
||||||
|
readonly type = SETUNREADNOTIFICATIONS;
|
||||||
|
|
||||||
|
constructor(public unread:number) {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export type Actions = OpenModal
|
export type Actions = OpenModal
|
||||||
| InitRoot
|
| InitRoot
|
||||||
@ -382,6 +391,7 @@ export type Actions = OpenModal
|
|||||||
| ToggleAppMenu
|
| ToggleAppMenu
|
||||||
| ToggleNotificationMenu
|
| ToggleNotificationMenu
|
||||||
| ToggleHelpMenu
|
| ToggleHelpMenu
|
||||||
| NotificationEvent;
|
| NotificationEvent
|
||||||
|
| SetUnreadNotifications;
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,6 +164,10 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
|
|||||||
}
|
}
|
||||||
return tassign(state,{unreadNotifications:unread});
|
return tassign(state,{unreadNotifications:unread});
|
||||||
}
|
}
|
||||||
|
case appCommonActions.SETUNREADNOTIFICATIONS: {
|
||||||
|
let a = action as appCommonActions.SetUnreadNotifications;
|
||||||
|
return tassign(state,{unreadNotifications:a.unread});
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user