mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Remember last used trending category and country
This commit is contained in:
@@ -2,7 +2,7 @@ import SwiftUI
|
||||
|
||||
struct TrendingCountry: View {
|
||||
static let prompt = "Country Name or Code"
|
||||
@Binding var selectedCountry: Country?
|
||||
@Binding var selectedCountry: Country
|
||||
|
||||
@StateObject private var store = Store(Country.allCases)
|
||||
|
||||
@@ -87,9 +87,7 @@ struct TrendingCountry: View {
|
||||
}
|
||||
|
||||
func selectCountryAndDismiss(_ country: Country? = nil) {
|
||||
let selected = country ?? selection
|
||||
|
||||
if selected != nil {
|
||||
if let selected = country ?? selection {
|
||||
selectedCountry = selected
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,13 @@
|
||||
import Defaults
|
||||
import Siesta
|
||||
import SwiftUI
|
||||
|
||||
struct TrendingView: View {
|
||||
@StateObject private var store = Store<[Video]>()
|
||||
|
||||
@State private var category: TrendingCategory = .default
|
||||
@State private var country: Country! = .pl
|
||||
@Default(.trendingCategory) private var category
|
||||
@Default(.trendingCountry) private var country
|
||||
|
||||
@State private var presentingCountrySelection = false
|
||||
|
||||
@EnvironmentObject<InvidiousAPI> private var api
|
||||
|
Reference in New Issue
Block a user