mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 18:54:11 +00:00
Fix tab selection
This commit is contained in:
@@ -5,11 +5,9 @@ struct ContentView: View {
|
||||
@ObservedObject private var state = AppState()
|
||||
@ObservedObject private var profile = Profile()
|
||||
|
||||
@Default(.tabSelection) var tabSelection
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
TabView(selection: $tabSelection) {
|
||||
TabView(selection: tabSelection) {
|
||||
SubscriptionsView()
|
||||
.tabItem { Text("Subscriptions") }
|
||||
.tag(TabSelection.subscriptions)
|
||||
@@ -40,6 +38,13 @@ struct ContentView: View {
|
||||
.environmentObject(state)
|
||||
.environmentObject(profile)
|
||||
}
|
||||
|
||||
var tabSelection: Binding<TabSelection> {
|
||||
Binding(
|
||||
get: { Defaults[.tabSelection] },
|
||||
set: { Defaults[.tabSelection] = $0 }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
|
Reference in New Issue
Block a user