mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-10 02:03:07 +08:00
fix(archive): With labels, "archive" means "remove from current label and add archive", not "remove from inbox"
This commit is contained in:
parent
371a2a4b08
commit
596db6e450
1 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
CategoryStore = require '../stores/category-store'
|
||||
FocusedCategoryStore = require '../stores/focused-category-store'
|
||||
|
||||
ChangeLabelsTask = require './change-labels-task'
|
||||
ChangeFolderTask = require './change-folder-task'
|
||||
|
@ -46,15 +47,16 @@ class ArchiveThreadHelper
|
|||
threadIds: threads.map (t) -> t.id
|
||||
|
||||
else if namespace.usesLabels()
|
||||
inboxLabel = CategoryStore.getStandardCategory("inbox")
|
||||
currentLabel = FocusedCategoryStore.category()
|
||||
currentLabel ?= CategoryStore.getStandardCategory("inbox")
|
||||
|
||||
params =
|
||||
threadIds: threads.map (t) -> t.id
|
||||
|
||||
if direction is "archive"
|
||||
params.labelsToRemove = [inboxLabel]
|
||||
params.labelsToRemove = [currentLabel]
|
||||
else if direction is "unarchive"
|
||||
params.labelsToAdd = [inboxLabel]
|
||||
params.labelsToAdd = [currentLabel]
|
||||
|
||||
archiveLabel = CategoryStore.getStandardCategory("archive")
|
||||
if archiveLabel
|
||||
|
|
Loading…
Reference in a new issue