From 618eae3102d18c50a2d3be605e552b8d3381bcf9 Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Fri, 30 Sep 2022 11:16:03 +0200 Subject: [PATCH] Show failure in ContactLookupView --- .../ContactLookupFeature/ContactLookupView.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Examples/xx-messenger/Sources/ContactLookupFeature/ContactLookupView.swift b/Examples/xx-messenger/Sources/ContactLookupFeature/ContactLookupView.swift index a8bcd339..d4a759d5 100644 --- a/Examples/xx-messenger/Sources/ContactLookupFeature/ContactLookupView.swift +++ b/Examples/xx-messenger/Sources/ContactLookupFeature/ContactLookupView.swift @@ -13,10 +13,12 @@ public struct ContactLookupView: View { init(state: ContactLookupState) { id = state.id isLookingUp = state.isLookingUp + failure = state.failure } var id: Data var isLookingUp: Bool + var failure: String? } public var body: some View { @@ -43,6 +45,14 @@ public struct ContactLookupView: View { } header: { Text("Contact ID") } + + if let failure = viewStore.failure { + Section { + Text(failure) + } header: { + Text("Error") + } + } } .navigationTitle("Lookup") } -- GitLab