More improvements and fixes (see commit description)

- put SwiftUI in an unstable feature
- Add Reset adi.pb to SwiftUI settings
- Add localizations to more things such as Error Log and Refresh Attempts
- Move debug logging into Advanced Settings
- Add padding to version text at the bottom of SwiftUI settings
- Add some things to Unstable Features such as nesting the Feature enum in UnstableFeatures and allowing on enable/disable hooks
- Don't use ObservableObject for UnstableFeatures as it's not needed
- fix a bug with unstable features where the toggle would be reverted if you go into another tab and then back
- Use SwiftUI advanced settings in UIKit
This commit is contained in:
naturecodevoid
2023-05-27 21:53:04 -07:00
parent d2c15b5acd
commit 026392dbc7
13 changed files with 341 additions and 199 deletions

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import minimuxer
private struct Server: Identifiable {
var id: String { value }
@@ -37,6 +38,9 @@ struct AdvancedSettingsView: View {
@AppStorage("customAnisetteURL")
var selectedAnisetteServer: String = ""
@AppStorage("isDebugLoggingEnabled")
var isDebugLoggingEnabled: Bool = false
var body: some View {
List {
Section {
@@ -60,8 +64,13 @@ struct AdvancedSettingsView: View {
Text(L10n.AdvancedSettingsView.AnisetteSettings.footer)
}
#if UNSTABLE // TODO: remove this once we have more settings for the danger zone.
Section {
Toggle(L10n.AdvancedSettingsView.DangerZone.debugLogging, isOn: self.$isDebugLoggingEnabled)
.onChange(of: self.isDebugLoggingEnabled) { value in
UserDefaults.shared.isDebugLoggingEnabled = value
set_debug(value)
}
#if UNSTABLE
NavigationLink(L10n.UnstableFeaturesView.title) {
UnstableFeaturesView(inDevMode: false)
@@ -71,7 +80,6 @@ struct AdvancedSettingsView: View {
} header: {
Text(L10n.AdvancedSettingsView.dangerZone)
}
#endif
}
.navigationTitle(L10n.AdvancedSettingsView.title)
.enableInjection()