mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-08-08 06:56:10 +00:00
fix(nostr-inbox): initialize NostrInboxService inside @MainActor initializers to satisfy actor isolation
This commit is contained in:
parent
fb60c929eb
commit
8ebb7411a7
@ -357,7 +357,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
||||
private var geoDmSubscriptionID: String? = nil
|
||||
private var currentGeohash: String? = nil
|
||||
private var geoNicknames: [String: String] = [:] // pubkeyHex(lowercased) -> nickname
|
||||
private let nostrInbox = NostrInboxService()
|
||||
private var nostrInbox: NostrInboxService
|
||||
private var nostrOutbox: NostrOutboxService
|
||||
|
||||
// MARK: - Caches
|
||||
@ -464,6 +464,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
||||
self.unifiedPeerService = UnifiedPeerService(meshService: meshService)
|
||||
let nostrTransport = NostrTransport()
|
||||
self.messageRouter = MessageRouter(mesh: meshService, nostr: nostrTransport)
|
||||
self.nostrInbox = NostrInboxService()
|
||||
self.nostrOutbox = NostrOutboxService(meshService: meshService)
|
||||
// Route receipts from PrivateChatManager through MessageRouter
|
||||
self.privateChatManager.messageRouter = self.messageRouter
|
||||
@ -709,6 +710,7 @@ class ChatViewModel: ObservableObject, BitchatDelegate {
|
||||
self.messageRouter = messageRouter
|
||||
self.readReceiptTracker = readReceiptTracker
|
||||
self.autocompleteService = AutocompleteService()
|
||||
self.nostrInbox = NostrInboxService()
|
||||
self.nostrOutbox = NostrOutboxService(meshService: meshService)
|
||||
|
||||
// Wire up dependencies
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user