commit 4f5c9b1bf7b6c2ea097cb3ff8ab30958ce53b33e parent 9aa68c15f718c012c16d4590f7216ef25848ccce Author: William Casarin <jb55@jb55.com> Date: Thu, 30 Jun 2022 07:11:40 -0700 config: don't add relay even if we've cancelled Changelog-Fixed: Cancel button on add relay view Signed-off-by: William Casarin <jb55@jb55.com> Diffstat:
M | damus/Views/ConfigView.swift | | | 9 | +++++++-- |
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/damus/Views/ConfigView.swift b/damus/Views/ConfigView.swift @@ -102,8 +102,13 @@ struct ConfigView: View { Text("Make sure your nsec account key is saved before you logout or you will lose access to this account") } .sheet(isPresented: $show_add_relay) { - AddRelayView(show_add_relay: $show_add_relay, relay: $new_relay) { _ in - guard let url = URL(string: new_relay) else { + AddRelayView(show_add_relay: $show_add_relay, relay: $new_relay) { m_relay in + + guard let relay = m_relay else { + return + } + + guard let url = URL(string: relay) else { return }