Fix crash when opening conversations in new windows

This commit is contained in:
Shadowfacts 2022-06-06 23:00:57 -04:00
parent 4991da1622
commit a4d43889ce
1 changed files with 6 additions and 2 deletions

View File

@ -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)
}))
}
}