osx: try badging icon for unread
This commit is contained in:
@@ -101,6 +101,11 @@ struct ConversationListView: View
|
||||
.map { Display.Conversation(from: $0) }
|
||||
|
||||
self.conversations = clientConversations
|
||||
|
||||
let unreadConversations = clientConversations.filter(\.isUnread)
|
||||
await MainActor.run {
|
||||
NSApplication.shared.dockTile.badgeLabel = unreadConversations.isEmpty ? nil : "\(unreadConversations.count)"
|
||||
}
|
||||
} catch {
|
||||
print("Error reloading conversations: \(error)")
|
||||
}
|
||||
|
||||
@@ -26,7 +26,11 @@ enum Display
|
||||
var isGroupChat: Bool {
|
||||
participants.count > 1
|
||||
}
|
||||
|
||||
|
||||
var isUnread: Bool {
|
||||
unreadCount > 0
|
||||
}
|
||||
|
||||
init(from c: Serialized.Conversation) {
|
||||
self.id = c.guid
|
||||
self.name = c.displayName
|
||||
|
||||
Reference in New Issue
Block a user