commit 4b54278378f56e8901d12f87a5fcb8722948ae21
parent 6e700e57269f5e8ef7f6466d4dc07b287643814c
Author: William Casarin <jb55@jb55.com>
Date: Fri, 10 Feb 2023 11:28:30 -0800
dismiss relay config on timeline change
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/damus/Views/Relays/RelayConfigView.swift b/damus/Views/Relays/RelayConfigView.swift
@@ -13,6 +13,8 @@ struct RelayConfigView: View {
@State var show_add_relay: Bool = false
@State var relays: [RelayDescriptor]
+ @Environment(\.dismiss) var dismiss
+
init(state: DamusState) {
self.state = state
_relays = State(initialValue: state.pool.descriptors)
@@ -33,6 +35,9 @@ struct RelayConfigView: View {
.onReceive(handle_notify(.relays_changed)) { _ in
self.relays = state.pool.descriptors
}
+ .onReceive(handle_notify(.switched_timeline)) { _ in
+ dismiss()
+ }
.sheet(isPresented: $show_add_relay) {
AddRelayView(show_add_relay: $show_add_relay, relay: $new_relay) { m_relay in
guard var relay = m_relay else {