Implements signals
This commit is contained in:
@@ -26,9 +26,6 @@ struct KordophoneApp: App
|
||||
ConversationListView(model: $conversationListModel)
|
||||
.frame(minWidth: 330.0)
|
||||
.xpcClient(xpcClient)
|
||||
.task {
|
||||
await refreshConversations()
|
||||
}
|
||||
} detail: {
|
||||
ConversationView(transcriptModel: $transcriptViewModel, entryModel: $entryViewModel)
|
||||
.xpcClient(xpcClient)
|
||||
@@ -42,15 +39,6 @@ struct KordophoneApp: App
|
||||
}
|
||||
}
|
||||
|
||||
private func refreshConversations() async {
|
||||
do {
|
||||
let conversations = try await xpcClient.getConversations()
|
||||
conversationListModel.conversations = conversations.map { Display.Conversation(from: $0) }
|
||||
} catch {
|
||||
reportError(error)
|
||||
}
|
||||
}
|
||||
|
||||
private func reportError(_ e: Error) {
|
||||
// Just printing for now.
|
||||
print("Error: \(e.localizedDescription)")
|
||||
|
||||
Reference in New Issue
Block a user