1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-12 21:30:32 +05:30

Fix sidebar navigation

This commit is contained in:
Arkadiusz Fal 2023-09-23 21:49:41 +02:00
parent d47ecb2723
commit 40ac137461
2 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,11 @@ final class NavigationModel: ObservableObject {
@Published var tabSelection: TabSelection! { didSet {
if oldValue == tabSelection { multipleTapHandler() }
if tabSelection == nil, let item = recents.presentedItem {
DispatchQueue.main.async { [weak self] in
self?.tabSelection = .recentlyOpened(item.tag)
}
}
}}
@Published var presentingAddToPlaylist = false

View File

@ -62,6 +62,12 @@ final class RecentsModel: ObservableObject {
return nil
}
var presentedItem: RecentItem? {
guard let recent = items.last else { return nil }
return recent
}
static func symbolSystemImage(_ name: String) -> String {
let firstLetter = name.first?.lowercased()
let regex = #"^[a-z0-9]$"#