autosyncing, appearance tweaks
This commit is contained in:
@@ -44,7 +44,9 @@ struct TextBubbleItemView: View
|
||||
let isFromMe: Bool
|
||||
|
||||
var body: some View {
|
||||
let bubbleColor: Color = isFromMe ? .blue : Color(.systemGray)
|
||||
let bubbleColor: Color = isFromMe ? .blue : Color(NSColor(name: "grayish", dynamicProvider: { appearance in
|
||||
appearance.name == .darkAqua ? .darkGray : NSColor(white: 0.78, alpha: 1.0)
|
||||
}))
|
||||
let textColor: Color = isFromMe ? .white : .primary
|
||||
|
||||
BubbleView(isFromMe: isFromMe) {
|
||||
|
||||
@@ -32,7 +32,9 @@ extension TranscriptView.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
displayItems.append(.message(message))
|
||||
if !message.text.isEmpty {
|
||||
displayItems.append(.message(message))
|
||||
}
|
||||
}
|
||||
|
||||
let animation: Animation? = animated ? .default : nil
|
||||
|
||||
@@ -113,6 +113,7 @@ struct TranscriptView: View
|
||||
Task { @MainActor [weak self] in
|
||||
guard let self else { return }
|
||||
|
||||
await markAsRead()
|
||||
await triggerSync()
|
||||
|
||||
setNeedsReload(animated: false)
|
||||
@@ -121,6 +122,16 @@ struct TranscriptView: View
|
||||
}
|
||||
}
|
||||
|
||||
func markAsRead() async {
|
||||
guard let displayedConversation else { return }
|
||||
|
||||
do {
|
||||
try await client.markConversationAsRead(conversationId: displayedConversation)
|
||||
} catch {
|
||||
print("Error triggering sync: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func triggerSync() async {
|
||||
guard let displayedConversation else { return }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user