Allow Open in New Window action on iPadOS
This commit is contained in:
parent
22803668d2
commit
0a894b219a
|
@ -210,15 +210,15 @@ extension MenuPreviewProvider {
|
|||
}),
|
||||
]
|
||||
|
||||
#if targetEnvironment(macCatalyst)
|
||||
shareSection.append(createAction(identifier: "new_window", title: "Open in New Window", systemImageName: "", handler: { (_) in
|
||||
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
|
||||
shareSection.append(createAction(identifier: "new_window", title: "Open in New Window", systemImageName: "rectangle.badge.plus", handler: { (_) in
|
||||
guard let id = mastodonController.accountInfo?.id else {
|
||||
return
|
||||
}
|
||||
// todo: this should try to find an existing session
|
||||
UIApplication.shared.requestSceneSessionActivation(nil, userActivity: UserActivityManager.showConversationActivity(mainStatusID: status.id, accountID: id), options: nil, errorHandler: nil)
|
||||
}))
|
||||
#endif
|
||||
}
|
||||
|
||||
return [
|
||||
UIMenu(title: "", image: nil, identifier: nil, options: [.displayInline], children: shareSection),
|
||||
|
|
Loading…
Reference in New Issue