Unify attention cards
This commit is contained in:
@@ -152,7 +152,7 @@ final class Drafts {
|
||||
comments[taskId] = nil
|
||||
changed = true
|
||||
}
|
||||
for id in Set(checked.keys).union(texts.keys) where !store.inbox.contains(where: { $0.id == id }) {
|
||||
for id in Set(checked.keys).union(texts.keys) where !keepsAnswer(store, id) {
|
||||
checked[id] = nil
|
||||
texts[id] = nil
|
||||
changed = true
|
||||
@@ -162,6 +162,14 @@ final class Drafts {
|
||||
}
|
||||
}
|
||||
|
||||
private func keepsAnswer(_ store: Store, _ id: String) -> Bool {
|
||||
let parts = id.split(separator: ":")
|
||||
if parts.first == "ready" && parts.count > 1 {
|
||||
return store.findTask(String(parts[1]))?.status == .active
|
||||
}
|
||||
return store.inbox.contains { $0.id == id }
|
||||
}
|
||||
|
||||
private func save() {
|
||||
dirty = true
|
||||
timer?.cancel()
|
||||
|
||||
Reference in New Issue
Block a user