mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 08:43:27 +01:00
Add Advanced Settings in-app
This commit is contained in:
@@ -14,6 +14,7 @@ import AltStoreCore
|
||||
import Intents
|
||||
|
||||
struct SettingsView: View {
|
||||
@ObservedObject private var iO = Inject.observer
|
||||
|
||||
var connectedAppleID: Team? {
|
||||
DatabaseManager.shared.activeTeam()
|
||||
@@ -174,8 +175,10 @@ struct SettingsView: View {
|
||||
}
|
||||
|
||||
SwiftUI.Button(L10n.SettingsView.switchToUIKit, action: self.switchToUIKit)
|
||||
|
||||
SwiftUI.Button("Advanced Settings", action: self.showAdvancedSettings)
|
||||
|
||||
NavigationLink(L10n.AdvancedSettingsView.title) {
|
||||
AdvancedSettingsView()
|
||||
}.foregroundColor(.accentColor)
|
||||
|
||||
SwiftUI.Button(L10n.SettingsView.resetImageCache, action: self.resetImageCache)
|
||||
.foregroundColor(.red)
|
||||
@@ -194,8 +197,7 @@ struct SettingsView: View {
|
||||
if isDevModeEnabled {
|
||||
NavigationLink(L10n.DevModeView.title, isActive: self.$isShowingDevModeMenu) {
|
||||
DevModeMenu()
|
||||
}
|
||||
.foregroundColor(.red)
|
||||
}.foregroundColor(.red)
|
||||
} else {
|
||||
SwiftUI.Button(L10n.DevModeView.title) {
|
||||
self.isShowingDevModePrompt = true
|
||||
@@ -234,6 +236,7 @@ struct SettingsView: View {
|
||||
.sheet(item: $externalURLToShow) { url in
|
||||
SafariView(url: url)
|
||||
}
|
||||
.enableInjection()
|
||||
}
|
||||
|
||||
|
||||
@@ -316,16 +319,6 @@ struct SettingsView: View {
|
||||
exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
func showAdvancedSettings() {
|
||||
// Create the URL that deep links to our app's custom settings.
|
||||
guard let url = URL(string: UIApplication.openSettingsURLString) else {
|
||||
return
|
||||
}
|
||||
|
||||
// Ask the system to open that URL.
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingsView_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user