Add notification when merging changes into the tree

This commit is contained in:
Thomas Nordquist
2019-04-08 00:57:32 +02:00
parent 436b569e93
commit 8c5f708386
5 changed files with 47 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ export enum ActionTypes {
showUpdateNotification = 'SHOW_UPDATE_NOTIFICATION',
showUpdateDetails = 'SHOW_UPDATE_DETAILS',
showError = 'SHOW_ERROR',
showNotification = 'SHOW_NOTIFICATION',
didLaunch = 'DID_LAUNCH',
}
@@ -19,6 +20,7 @@ export interface CustomAction extends Action {
showUpdateNotification?: boolean
showUpdateDetails?: boolean
error?: string
notification?: string
}
export interface AppState {
@@ -34,6 +36,7 @@ export interface GlobalState {
showUpdateNotification?: boolean
showUpdateDetails: boolean
error?: string
notification?: string
launching: boolean
}
@@ -61,6 +64,13 @@ const globalState: Reducer<GlobalState | undefined, CustomAction> = (state = ini
error: action.error,
}
case ActionTypes.showNotification:
console.log(action)
return {
...state,
notification: action.notification,
}
case ActionTypes.didLaunch:
return {
...state,