Merge changes when resuming

This commit is contained in:
Thomas Nordquist
2019-04-09 01:51:31 +02:00
parent f5de7903e7
commit 2812baccf9

View File

@@ -68,11 +68,17 @@ export const togglePause = (tree?: q.Tree<TopicViewModel>) => (dispatch: Dispatc
dispatch(globalActions.showNotification('Applying recorded changes.')) 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({ dispatch({
type: paused ? ActionTypes.TREE_RESUME_UPDATES : ActionTypes.TREE_PAUSE_UPDATES, type: paused ? ActionTypes.TREE_RESUME_UPDATES : ActionTypes.TREE_PAUSE_UPDATES,
}) })
if (paused && changes > 0) {
dispatch(globalActions.showNotification(`Sucessfully applied ${changes} changes.`))
}
} }