mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-04 07:10:06 +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) {
|
||||
data.previousFolders = {};
|
||||
}
|
||||
if (data.threads) {
|
||||
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 t of (data.threads || [])) {
|
||||
data.previousFolders[t.id] = t.folders.find(f => f.id !== data.folder.id) || t.folders[0];
|
||||
}
|
||||
}
|
||||
if (data.messages) {
|
||||
data.messages = data.messages.filter(m => m.folder.id !== data.folder.id);
|
||||
for (const m of data.messages) {
|
||||
for (const m of (data.messages || [])) {
|
||||
data.previousFolders[m.id] = m.folder;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue