mirror of
https://github.com/yattee/yattee.git
synced 2025-10-13 10:58:11 +00:00
Replace environment objects with observed objects
This commit is contained in:
@@ -2,6 +2,8 @@ import Defaults
|
||||
import Foundation
|
||||
|
||||
final class RecentsModel: ObservableObject {
|
||||
static var shared = RecentsModel()
|
||||
|
||||
@Default(.recentlyOpened) var items
|
||||
@Default(.saveRecents) var saveRecents
|
||||
|
||||
@@ -35,9 +37,9 @@ final class RecentsModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func addQuery(_ query: String, navigation: NavigationModel? = nil) {
|
||||
func addQuery(_ query: String) {
|
||||
if !query.isEmpty {
|
||||
navigation?.tabSelection = .search
|
||||
NavigationModel.shared.tabSelection = .search
|
||||
add(.init(from: query))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user