mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 13:25:20 +00:00
Gate relays on mutual favorites and add Tor toggle (#631)
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user