From 0fc9957f37764461d0c50e440523dff47444260e Mon Sep 17 00:00:00 2001 From: Chris Whong Date: Thu, 26 Sep 2019 13:37:51 -0400 Subject: [PATCH] feat: add toast on create --- app/reducers/ui.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/reducers/ui.ts b/app/reducers/ui.ts index 4f895c83..cafe2fcf 100644 --- a/app/reducers/ui.ts +++ b/app/reducers/ui.ts @@ -55,6 +55,7 @@ ipcRenderer.send('block-menus', true) const [, DATASET_SUCC] = apiActionTypes('dataset') const [, ADD_SUCC] = apiActionTypes('add') +const [, INIT_SUCC] = apiActionTypes('init') export default (state = initialState, action: AnyAction) => { switch (action.type) { @@ -171,12 +172,13 @@ export default (state = initialState, action: AnyAction) => { } case ADD_SUCC: + case INIT_SUCC: const { peername, name } = action.payload.data return { ...state, toast: { type: 'success', - message: `Added dataset ${peername}/${name}`, + message: `${action.type === ADD_SUCC ? 'Added' : 'Created new'} dataset ${peername}/${name}`, visible: true } }