This commit is contained in:
Ethan Pippin 2023-09-15 14:32:37 -06:00 committed by GitHub
parent f16f15e631
commit 07092221d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 1 deletions

View File

@ -39,6 +39,11 @@ final class SettingsCoordinator: NavigationCoordinatable {
var serverDetail = makeServerDetail
@Route(.push)
var videoPlayerSettings = makeVideoPlayerSettings
#if DEBUG
@Route(.push)
var debugSettings = makeDebugSettings
#endif
#endif
#if os(tvOS)
@ -103,6 +108,13 @@ final class SettingsCoordinator: NavigationCoordinatable {
ServerDetailView(viewModel: .init(server: server))
}
#if DEBUG
@ViewBuilder
func makeDebugSettings() -> some View {
DebugSettingsView()
}
#endif
func makeVideoPlayerSettings() -> VideoPlayerSettingsCoordinator {
VideoPlayerSettingsCoordinator()
}

View File

@ -214,6 +214,6 @@ extension UserDefaults {
extension Defaults.Keys {
static let sendProgressReports: Key<Bool> = .init("sendProgressReports", default: false, suite: .debugSuite)
static let sendProgressReports: Key<Bool> = .init("sendProgressReports", default: true, suite: .debugSuite)
}
#endif

View File

@ -20,6 +20,7 @@ struct DebugSettingsView: View {
Toggle("Send Progress Reports", isOn: $sendProgressReports)
}
.navigationTitle("Debug")
}
}
#endif

View File

@ -116,6 +116,15 @@ struct SettingsView: View {
.onSelect {
router.route(to: \.log)
}
#if DEBUG
ChevronButton(title: "Debug")
.onSelect {
router.route(to: \.debugSettings)
}
#endif
}
.navigationBarTitle(L10n.settings)
.navigationBarTitleDisplayMode(.inline)