Fix drag from label to label not removing origin label

This commit is contained in:
Ben Gotow 2017-06-28 22:42:29 -07:00
parent 72a4cbd3dd
commit 2dce6fcb6a

View file

@ -325,14 +325,14 @@ class CategoryMailboxPerspective extends MailboxPerspective
currentCat = current.categories().find((c) -> c.accountId == accountId)
if myCat instanceof Folder
# folder/label to folder
return new ChangeFolderTask({
threads: accountThreads,
source: "Dragged into list",
folder: myCat,
})
# We are a label!
if currentCat instanceof Folder
else if myCat instanceof Label and currentCat instanceof Folder
# folder to label
# dragging from trash or spam into a label? We need to both apply the label and move.
return [
new ChangeFolderTask({
@ -347,11 +347,13 @@ class CategoryMailboxPerspective extends MailboxPerspective
})
]
else
# label to label
return [
new ChangeLabelsTask({
threads: accountThreads,
source: "Dragged into list",
labelsToAdd: [myCat],
labelsToRemove: [currentCat],
})
]
)