From ae4a90bda5d0047fb1276156d537ac6d380406be Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sun, 18 Feb 2024 14:28:42 +0100 Subject: [PATCH] Bugfix: when moving a folder/mailbox check for parent delimiter --- dev/Model/FolderCollection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/Model/FolderCollection.js b/dev/Model/FolderCollection.js index 040c79c04..0e15fee68 100644 --- a/dev/Model/FolderCollection.js +++ b/dev/Model/FolderCollection.js @@ -488,8 +488,9 @@ export class FolderModel extends AbstractModel { rename(nameToEdit, parentName) { nameToEdit = nameToEdit.trim(); const folder = this, + parentFolder = getFolderFromCacheList(parentName), oldFullname = folder.fullName, - newFullname = parentName + folder.delimiter + nameToEdit; + newFullname = (parentFolder ? (parentName + parentFolder.delimiter) : '') + nameToEdit; if (nameToEdit && newFullname != oldFullname) { Remote.abort('Folders').post('FolderRename', FolderUserStore.foldersRenaming, { oldName: oldFullname, @@ -508,8 +509,7 @@ export class FolderModel extends AbstractModel { } else { removeFolderFromCacheList(folder.fullName); setFolder(folder); - const parent = getFolderFromCacheList(folder.parentName); - sortFolders(parent ? parent.subFolders : FolderUserStore.folderList); + sortFolders(parentFolder ? parentFolder.subFolders : FolderUserStore.folderList); } }) .catch(error => {