From 5b4c46f5214699ddc8875cc12234b1e2e02cdb01 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 27 Feb 2022 14:42:50 +0100 Subject: [PATCH] Fix MOVE_FOLDER UX: Run mutation before manipulating data Signed-off-by: Marcel Klehr --- src/store/actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/actions.js b/src/store/actions.js index 88139cf2..fc7b37ae 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -757,9 +757,9 @@ export default { if (folderId === folder.id) { throw new Error('Cannot move folder into itself') } + commit(mutations.MOVE_FOLDER, { folder: folder.id, target: folderId }) const oldParent = folder.parent_folder folder.parent_folder = folderId - commit(mutations.MOVE_FOLDER, { folder: folder.id, target: folderId }) await dispatch(actions.SAVE_FOLDER, folder.id) // reloads children order for new parent dispatch( actions.LOAD_FOLDER_CHILDREN_ORDER,