From a4d43889ce44587c977e9ff7546b8f25ca99c3de Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 6 Jun 2022 23:00:57 -0400 Subject: [PATCH] Fix crash when opening conversations in new windows --- Tusker/Screens/Utilities/Previewing.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Utilities/Previewing.swift b/Tusker/Screens/Utilities/Previewing.swift index cc76889f56..7a991ee683 100644 --- a/Tusker/Screens/Utilities/Previewing.swift +++ b/Tusker/Screens/Utilities/Previewing.swift @@ -362,11 +362,15 @@ extension MenuActionProvider { let options = UIWindowScene.ActivationRequestOptions() options.preferredPresentationStyle = .automatic actions.append(UIWindowScene.ActivationAction { (_) in - return .init(userActivity: activity(), options: options, preview: nil) + let activity = activity() + activity.displaysAuxiliaryScene = true + return .init(userActivity: activity, options: options, preview: nil) }) } else if UIApplication.shared.supportsMultipleScenes { actions.append(createAction(identifier: "new_window", title: "Open in New Window", systemImageName: "rectangle.badge.plus", handler: { (_) in - UIApplication.shared.requestSceneSessionActivation(nil, userActivity: activity(), options: nil, errorHandler: nil) + let activity = activity() + activity.displaysAuxiliaryScene = true + UIApplication.shared.requestSceneSessionActivation(nil, userActivity: activity, options: nil, errorHandler: nil) })) } }