Skip to content

Commit

Permalink
Name essential destinations as such
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Jul 30, 2024
1 parent 5dbec08 commit 1cd498d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Fyreplace/FyreplaceApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ struct FyreplaceApp: App {
}

guard let dsn = Config.default.sentry.dsn, !dsn.isEmpty else { return }
SentrySDK.start { options in
options.dsn = dsn
options.environment = Config.default.version.environment

SentrySDK.start {
$0.dsn = dsn
$0.environment = Config.default.version.environment
}
}

Expand Down
8 changes: 4 additions & 4 deletions Fyreplace/Views/Navigation/CompactNavigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ struct CompactNavigation: View {
@SceneStorage("CompactNavigation.selectedTab")
private var selectedTab = Destination.feed

@SceneStorage("CompactNavigation.choices")
private var choices = Destination.all.filter { $0.parent == nil }
@SceneStorage("CompactNavigation.selectedChoices")
private var selectedChoices = Destination.essentials

var body: some View {
TabView(selection: $selectedTab) {
let destinations = Destination.all.filter { $0.parent == nil }
let destinations = Destination.essentials

ForEach(Array(destinations.enumerated()), id: \.element.id) { i, destination in
NavigationStack {
Expand All @@ -20,7 +20,7 @@ struct CompactNavigation: View {
} else {
MultiChoiceScreen(
choices: [destination] + children,
choice: $choices[i]
choice: $selectedChoices[i]
)
}
}
Expand Down
2 changes: 2 additions & 0 deletions Fyreplace/Views/Navigation/Destination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ public enum Destination: String, CaseIterable, Identifiable, Codable {
}

static let all = allCases.filter(\.topLevel)

static let essentials = all.filter { $0.parent == nil }
}

0 comments on commit 1cd498d

Please sign in to comment.