File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -736,11 +736,25 @@ class SwiftuiInterface : NSObject {
736736 @objc
737737 func makeOwnOmemoKeyView( _ ownContact: MLContact ? ) -> UIViewController {
738738 let host = UIHostingController ( rootView: AnyView ( EmptyView ( ) ) )
739- if ( ownContact == nil ) {
740- host. rootView = AnyView ( UIKitWorkaround ( OmemoKeysView ( omemoKeys: OmemoKeysForChat ( viewContact: nil ) ) ) )
739+ let delegate = SheetDismisserProtocol ( )
740+ delegate. host = host
741+
742+ @ViewBuilder
743+ var omemoKeysView : some View {
744+ if ( ownContact == nil ) {
745+ OmemoKeysView ( omemoKeys: OmemoKeysForChat ( viewContact: nil ) )
746+ } else {
747+ OmemoKeysView ( omemoKeys: OmemoKeysForChat ( viewContact: ObservableKVOWrapper < MLContact > ( ownContact!) ) )
748+ }
749+ }
750+
751+ if ( UIDevice . current. userInterfaceIdiom == . phone) || ProcessInfo ( ) . isMacCatalystApp {
752+ host. rootView = AnyView ( UIKitWorkaround ( omemoKeysView) )
741753 } else {
742- host. rootView = AnyView ( UIKitWorkaround ( OmemoKeysView ( omemoKeys: OmemoKeysForChat ( viewContact: ObservableKVOWrapper < MLContact > ( ownContact!) ) ) ) )
754+ // The app is running on an iPad
755+ host. rootView = AnyView ( AddTopLevelNavigation ( withDelegate: delegate, to: omemoKeysView) )
743756 }
757+
744758 return host
745759 }
746760
You can’t perform that action at this time.
0 commit comments