diff --git a/Examples/xx-messenger/Sources/ChatFeature/ChatView.swift b/Examples/xx-messenger/Sources/ChatFeature/ChatView.swift index 1611815c087786954fd730fe1768760801a7ea73..ac0d088440faf4d8b381c9aec05be9968fc1ba4e 100644 --- a/Examples/xx-messenger/Sources/ChatFeature/ChatView.swift +++ b/Examples/xx-messenger/Sources/ChatFeature/ChatView.swift @@ -16,6 +16,7 @@ public struct ChatView: View { var failure: String? var sendFailure: String? var text: String + var disableImagePicker: Bool init(state: ChatComponent.State) { myContactId = state.myContactId @@ -23,6 +24,12 @@ public struct ChatView: View { failure = state.failure sendFailure = state.sendFailure text = state.text + switch state.id { + case .contact(_): + disableImagePicker = false + case .group(_): + disableImagePicker = true + } } } @@ -109,6 +116,7 @@ public struct ChatView: View { } } } + .disabled(viewStore.disableImagePicker) } } .padding()