Gate relays on mutual favorites and add Tor toggle (#631)

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
jack
2025-09-16 08:12:51 -07:00
committed by GitHub
co-authored by jack
parent 482fca81ef
commit 54bb812469
7 changed files with 297 additions and 84 deletions
+20
View File
@@ -778,6 +778,12 @@ final class ChatViewModel: ObservableObject, BitchatDelegate {
name: .TorWillStart,
object: nil
)
NotificationCenter.default.addObserver(
self,
selector: #selector(handleTorPreferenceChanged(_:)),
name: .TorUserPreferenceChanged,
object: nil
)
#else
NotificationCenter.default.addObserver(
self,
@@ -828,6 +834,12 @@ final class ChatViewModel: ObservableObject, BitchatDelegate {
name: .TorWillStart,
object: nil
)
NotificationCenter.default.addObserver(
self,
selector: #selector(handleTorPreferenceChanged(_:)),
name: .TorUserPreferenceChanged,
object: nil
)
#endif
}
@@ -869,6 +881,14 @@ final class ChatViewModel: ObservableObject, BitchatDelegate {
}
}
}
@objc private func handleTorPreferenceChanged(_ notification: Notification) {
Task { @MainActor in
self.torStatusAnnounced = false
self.torInitialReadyAnnounced = false
self.torRestartPending = false
}
}
// Resubscribe to the active geohash channel without clearing timeline
@MainActor