From e062ad96cede2336ba598f6cfde8ba964a05a28f Mon Sep 17 00:00:00 2001 From: Terry Yiu <963907+tyiu@users.noreply.github.com> Date: Sun, 19 May 2024 07:23:40 -0400 Subject: [PATCH] Fix demo app to not crash when removing relays (#157) --- Sources/NostrSDK/RelayPool.swift | 2 +- demo/NostrSDKDemo/Demo Views/DirectMessageDemoView.swift | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/NostrSDK/RelayPool.swift b/Sources/NostrSDK/RelayPool.swift index cdd30a5..0db1bad 100644 --- a/Sources/NostrSDK/RelayPool.swift +++ b/Sources/NostrSDK/RelayPool.swift @@ -14,7 +14,7 @@ import os.log public final class RelayPool: ObservableObject, RelayOperating { /// The set of relays. - public private(set) var relays = Set() + @Published public private(set) var relays = Set() /// A Publisher that publishes all events from all relays. @Published public private(set) var events = PassthroughSubject() diff --git a/demo/NostrSDKDemo/Demo Views/DirectMessageDemoView.swift b/demo/NostrSDKDemo/Demo Views/DirectMessageDemoView.swift index 1c70186..dbe7659 100644 --- a/demo/NostrSDKDemo/Demo Views/DirectMessageDemoView.swift +++ b/demo/NostrSDKDemo/Demo Views/DirectMessageDemoView.swift @@ -59,7 +59,6 @@ struct DirectMessageDemoView: View, EventCreating { } else { return Keypair(hex: senderPrivateKey) } - return nil } private func publicKey() -> PublicKey? {