mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-27 01:28:56 +08:00
Bugfix: when moving a folder/mailbox check for parent delimiter
This commit is contained in:
parent
859b064d39
commit
ae4a90bda5
1 changed files with 3 additions and 3 deletions
|
@ -488,8 +488,9 @@ export class FolderModel extends AbstractModel {
|
||||||
rename(nameToEdit, parentName) {
|
rename(nameToEdit, parentName) {
|
||||||
nameToEdit = nameToEdit.trim();
|
nameToEdit = nameToEdit.trim();
|
||||||
const folder = this,
|
const folder = this,
|
||||||
|
parentFolder = getFolderFromCacheList(parentName),
|
||||||
oldFullname = folder.fullName,
|
oldFullname = folder.fullName,
|
||||||
newFullname = parentName + folder.delimiter + nameToEdit;
|
newFullname = (parentFolder ? (parentName + parentFolder.delimiter) : '') + nameToEdit;
|
||||||
if (nameToEdit && newFullname != oldFullname) {
|
if (nameToEdit && newFullname != oldFullname) {
|
||||||
Remote.abort('Folders').post('FolderRename', FolderUserStore.foldersRenaming, {
|
Remote.abort('Folders').post('FolderRename', FolderUserStore.foldersRenaming, {
|
||||||
oldName: oldFullname,
|
oldName: oldFullname,
|
||||||
|
@ -508,8 +509,7 @@ export class FolderModel extends AbstractModel {
|
||||||
} else {
|
} else {
|
||||||
removeFolderFromCacheList(folder.fullName);
|
removeFolderFromCacheList(folder.fullName);
|
||||||
setFolder(folder);
|
setFolder(folder);
|
||||||
const parent = getFolderFromCacheList(folder.parentName);
|
sortFolders(parentFolder ? parentFolder.subFolders : FolderUserStore.folderList);
|
||||||
sortFolders(parent ? parent.subFolders : FolderUserStore.folderList);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
Loading…
Reference in a new issue