mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
Attempt to optimize changeFolderTask can cause it to be invalid
This commit is contained in:
parent
40e932074a
commit
5a18196c6d
1 changed files with 3 additions and 9 deletions
|
@ -32,16 +32,10 @@ export default class ChangeFolderTask extends ChangeMailTask {
|
||||||
}
|
}
|
||||||
if (!data.previousFolders) {
|
if (!data.previousFolders) {
|
||||||
data.previousFolders = {};
|
data.previousFolders = {};
|
||||||
}
|
for (const t of (data.threads || [])) {
|
||||||
if (data.threads) {
|
data.previousFolders[t.id] = t.folders.find(f => f.id !== data.folder.id) || t.folders[0];
|
||||||
data.threads = data.threads.filter(t => t.folders.find(f => f.id !== data.folder.id));
|
|
||||||
for (const t of data.threads) {
|
|
||||||
data.previousFolders[t.id] = t.folders.find(f => f.id !== data.folder.id);
|
|
||||||
}
|
}
|
||||||
}
|
for (const m of (data.messages || [])) {
|
||||||
if (data.messages) {
|
|
||||||
data.messages = data.messages.filter(m => m.folder.id !== data.folder.id);
|
|
||||||
for (const m of data.messages) {
|
|
||||||
data.previousFolders[m.id] = m.folder;
|
data.previousFolders[m.id] = m.folder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue