Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/AppDebugMode/Providers/AppDebugModeProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class AppDebugModeProvider {
public extension AppDebugModeProvider {

func setup(
serversCollections: [ApiServerCollection],
serversCollections: [ApiServerCollection] = [],
onServerChange: (() -> Void)? = nil,
cacheManager: Any? = nil,
firebaseMessaging: AnyObject? = nil
Expand Down
41 changes: 25 additions & 16 deletions Sources/AppDebugMode/Views/AppDebugView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,51 @@ struct AppDebugView: View {
// MARK: - Init

init(serversCollections: [ApiServerCollection]) {
self.screens = [
Screen(
self.screens = []

if !AppDebugModeProvider.shared.serversCollections.isEmpty {
self.screens.append(Screen(
title: "Server settings",
image: Image(systemName: "server.rack"),
destination: AnyView(ServersCollectionsView(
viewModel: ServersCollectionsViewModel(
serversCollections: serversCollections
)
))
),
Screen(
title: "User profiles",
image: Image(systemName: "person.2"),
destination: AnyView(UserProfilesPickerView())
)
]

))
}

self.screens.append(Screen(
title: "User profiles",
image: Image(systemName: "person.2"),
destination: AnyView(UserProfilesPickerView())
))

if let pushNotificationsProvider = AppDebugModeProvider.shared.pushNotificationsProvider {
self.screens.append(Screen(
title: "Push notifications",
image: Image(systemName: "bell.badge"),
destination: AnyView(PushNotificationsSettingsView(pushNotificationsProvider: pushNotificationsProvider))
))
}
self.screens.append(contentsOf: [
Screen(

if !CacheProvider.shared.userDefaultValues.isEmpty {
self.screens.append(Screen(
title: "User defaults",
image: Image(systemName: "externaldrive"),
destination: AnyView(UserDefaultsSettingsView())
),
Screen(
))
}

if !CacheProvider.shared.keychainValues.isEmpty {
self.screens.append(Screen(
title: "Keychain settings",
image: Image(systemName: "key"),
destination: AnyView(KeychainSettingsView())
),
))
}

self.screens.append(contentsOf: [
Screen(
title: "App directory",
image: Image(systemName: "folder"),
Expand Down