mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-14 16:44:36 +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
58dcf3ae22
commit
5f66ee4cef
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…
Add table
Reference in a new issue