From 0a894b219aafae3ac80b0af14fabbedcb045ba1c Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 9 Jun 2021 17:09:59 -0400 Subject: [PATCH] Allow Open in New Window action on iPadOS --- Tusker/Screens/Utilities/Previewing.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tusker/Screens/Utilities/Previewing.swift b/Tusker/Screens/Utilities/Previewing.swift index 14e3ac0005..00cef4061a 100644 --- a/Tusker/Screens/Utilities/Previewing.swift +++ b/Tusker/Screens/Utilities/Previewing.swift @@ -210,15 +210,15 @@ extension MenuPreviewProvider { }), ] - #if targetEnvironment(macCatalyst) - shareSection.append(createAction(identifier: "new_window", title: "Open in New Window", systemImageName: "", 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 + 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) + })) + } return [ UIMenu(title: "", image: nil, identifier: nil, options: [.displayInline], children: shareSection),