forked from BDGHubNoKey/SideStore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemp_edit.swift
More file actions
31 lines (28 loc) · 1.31 KB
/
temp_edit.swift
File metadata and controls
31 lines (28 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// This is a temporary file for editing the enableJIT function
// The function should be part of a class or extension, not standalone
extension MyAppsViewController {
func enableJIT(for installedApp: InstalledApp) {
// Check if JIT API URL is configured
let jitAPIURL = UserDefaults.standard.string(forKey: "jit_api_base_url")
if jitAPIURL == nil {
// Show alert to configure JIT API URL
let alert = UIAlertController(title: "JIT API Not Configured",
message: "Please configure the JIT API URL in Settings before enabling JIT.",
preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self.present(alert, animated: true, completion: nil)
return
}
AppManager.shared.enableJIT(for: installedApp) { result in
DispatchQueue.main.async {
switch result {
case .success:
break
case .failure(let error):
ToastView(error: error, opensLog: true).show(in: self)
AppManager.shared.log(error, operation: .enableJIT, app: installedApp)
}
}
}
}
}