Fix MOVE_FOLDER UX: Run mutation before manipulating data

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2022-02-27 14:42:50 +01:00
parent c2375a00f6
commit 5b4c46f521
1 changed files with 1 additions and 1 deletions

View File

@ -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,