From 2846ce4e4b1ad4f5a964eaf8db4fa050ecef9347 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Thu, 23 Nov 2023 16:59:22 +0100 Subject: [PATCH] Show alert on iPad (#1172) --- Mastodon/Coordinator/SceneCoordinator.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Mastodon/Coordinator/SceneCoordinator.swift b/Mastodon/Coordinator/SceneCoordinator.swift index 4a01c4ea5..400042065 100644 --- a/Mastodon/Coordinator/SceneCoordinator.swift +++ b/Mastodon/Coordinator/SceneCoordinator.swift @@ -601,10 +601,19 @@ extension SceneCoordinator: MastodonLoginViewControllerDelegate { //MARK: - SettingsCoordinatorDelegate extension SceneCoordinator: SettingsCoordinatorDelegate { func logout(_ settingsCoordinator: SettingsCoordinator) { + + let preferredStyle: UIAlertController.Style + + if UIDevice.current.userInterfaceIdiom == .phone { + preferredStyle = .actionSheet + } else { + preferredStyle = .alert + } + let alertController = UIAlertController( title: L10n.Common.Alerts.SignOut.title, message: L10n.Common.Alerts.SignOut.message, - preferredStyle: .actionSheet + preferredStyle: preferredStyle ) let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .cancel)