diff options
Diffstat (limited to 'Hutch/Models')
| -rw-r--r-- | Hutch/Models/Inbox.swift | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Hutch/Models/Inbox.swift b/Hutch/Models/Inbox.swift index 720c71f..54e2685 100644 --- a/Hutch/Models/Inbox.swift +++ b/Hutch/Models/Inbox.swift @@ -178,6 +178,12 @@ enum InboxReadStateStore { defaults.set(dictionary, forKey: key) } + static func markUnread(for threadID: String, defaults: UserDefaults = .standard) { + var dictionary = defaults.dictionary(forKey: key) as? [String: TimeInterval] ?? [:] + dictionary.removeValue(forKey: threadID) + defaults.set(dictionary, forKey: key) + } + static func isUnread(threadID: String, lastActivityAt: Date, defaults: UserDefaults = .standard) -> Bool { guard let lastViewedAt = lastViewedAt(for: threadID, defaults: defaults) else { return true |
