Skip to content

Commit d9a7d0f

Browse files
committed
feat: error alert for no config content
1 parent f8e1d73 commit d9a7d0f

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

Loader/Resources/Localizable.xcstrings

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@
5353
}
5454
}
5555
},
56+
"Bootstrap, managers, and configuration is not available for current jailbreak type" : {
57+
"extractionState" : "manual",
58+
"localizations" : {
59+
"en" : {
60+
"stringUnit" : {
61+
"state" : "translated",
62+
"value" : "Bootstrap, managers, and configuration is not available for current jailbreak type \"%@\""
63+
}
64+
}
65+
}
66+
},
5667
"Cancel" : {
5768
"comment" : "The cancel action for alerts",
5869
"extractionState" : "manual",

Loader/Utilities/Config/Models/LRConfig.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ struct LRConfig: Codable {
3030
private let contents: [LRConfigContent]
3131

3232
private func findCompatibleContents() -> LRConfigContent? {
33-
let activePlatform = Int(dyld_get_active_platform())
34-
35-
return contents.filter { content in
36-
content.platform == activePlatform
33+
contents.filter { content in
34+
content.platform == Int(dyld_get_active_platform())
3735
}.first
3836
}
3937

Loader/Views/Bootstrap/LRStagedViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class LRStagedViewController: LRBaseStagedViewController {
9999
#if !targetEnvironment(simulator)
100100
UIAlertController.showAlert(
101101
self,
102-
title: ":(",
102+
title: "",
103103
message: error.localizedDescription,
104104
actions: []
105105
)

Loader/Views/Selection/LRBootstrapViewController.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ class LRBootstrapViewController: LRBaseTableViewController {
6060
case .success(let data):
6161
self._data = data
6262
self.tableView.reloadDataWithTransition(with: .transitionCrossDissolve, duration: 0.4)
63+
64+
if data.content() == nil {
65+
UIAlertController.showAlert(
66+
self,
67+
title: "",
68+
message: .localized(
69+
"Bootstrap, managers, and configuration is not available for current jailbreak type",
70+
arguments: UIDevice.current.palera1n.palerain_option_rootless ? "rootless" : "rootful"
71+
),
72+
actions: [UIAlertAction(title: "OK", style: .cancel)]
73+
)
74+
}
6375
case .failure(let error):
6476
self._showError(error.localizedDescription)
6577
}

Loader/Views/Settings/Credits/LRSettingsCreditsViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class LRSettingsCreditsViewController: LRBaseTableViewController {
8282

8383
UIAlertController.showAlert(
8484
self,
85-
title: ":(",
85+
title: "",
8686
message: message,
8787
actions: [ok, retry]
8888
)

0 commit comments

Comments
 (0)