Skip to content

Commit

Permalink
Add ArchiveCategory.defaultCategory (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolsinga authored Aug 26, 2024
1 parent 921e8c8 commit 1f70de9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Sources/Site/Music/UI/ArchiveCategory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public enum ArchiveCategory: String, CaseIterable {
case artists
case classic

static var defaultCategory: ArchiveCategory? { nil }

var localizedString: String {
switch self {
case .today:
Expand Down
4 changes: 3 additions & 1 deletion Sources/Site/Music/UI/ArchiveStorageModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ struct ArchiveStorageModifier: ViewModifier {
defer {
Logger.storage.log("end restore")
}

let archiveCategory =
selectedCategoryStorage != nil ? ArchiveCategory(rawValue: selectedCategoryStorage!) : nil
selectedCategoryStorage != nil
? ArchiveCategory(rawValue: selectedCategoryStorage!) : .defaultCategory
archiveNavigation.restoreNavigation(
selectedCategoryStorage: archiveCategory, pathData: navigationPathData)
}
Expand Down

0 comments on commit 1f70de9

Please sign in to comment.