Skip to content

Commit 33080df

Browse files
committed
fix: actionSheet crash on ipad
1 parent cc39bb8 commit 33080df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Loader/Views/Settings/LRSettingsViewController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class LRSettingsViewController: LRBaseStructuredTableViewController {
9191
: String.localized("Restore System"),
9292
tint: .systemRed,
9393
action: {
94-
9594
let action = UIAlertAction(
9695
title: UIDevice.current.palera1n.shouldCleanFakefs
9796
? String.localized("Clean FakeFS")
@@ -103,13 +102,17 @@ class LRSettingsViewController: LRBaseStructuredTableViewController {
103102
}
104103
}
105104

105+
var style: UIAlertController.Style = UIDevice.current.userInterfaceIdiom == .pad
106+
? .alert
107+
: .actionSheet
108+
106109
UIAlertController.showAlertWithCancel(
107110
self,
108111
title: UIDevice.current.palera1n.shouldCleanFakefs
109112
? String.localized("Clean FakeFS Explanation", arguments: UIDevice.current.marketingModel)
110113
: String.localized("Restore System Explanation", arguments: UIDevice.current.marketingModel),
111114
message: nil,
112-
style: .actionSheet,
115+
style: style,
113116
actions: [action]
114117
)
115118
}

0 commit comments

Comments
 (0)