From 2812baccf9179761d8163c2501be44f07094e81c Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Tue, 9 Apr 2019 01:51:31 +0200 Subject: [PATCH] Merge changes when resuming --- app/src/actions/Tree.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/actions/Tree.ts b/app/src/actions/Tree.ts index 14301de..886699d 100644 --- a/app/src/actions/Tree.ts +++ b/app/src/actions/Tree.ts @@ -68,11 +68,17 @@ export const togglePause = (tree?: q.Tree) => (dispatch: Dispatc dispatch(globalActions.showNotification('Applying recorded changes.')) } + // Allow for notification to be displayed + setTimeout(() => { + tree && tree.applyUnmergedChanges() + if (paused && changes > 0) { + dispatch(globalActions.showNotification(`Sucessfully applied ${changes} changes.`)) + } + }, 50) + dispatch({ type: paused ? ActionTypes.TREE_RESUME_UPDATES : ActionTypes.TREE_PAUSE_UPDATES, }) - if (paused && changes > 0) { - dispatch(globalActions.showNotification(`Sucessfully applied ${changes} changes.`)) - } + }