Fix tabs sometimes not switching

This is the dumbest code I've ever written

Changelog-Fixed: Fix tabs sometimes not switching
This commit is contained in:
William Casarin
2023-04-11 14:52:11 -07:00
parent 10cab37270
commit 1320ff6bec
2 changed files with 7 additions and 0 deletions

View File

@@ -96,6 +96,9 @@ struct ContentView: View {
VStack {
ZStack {
TabView(selection: $filter_state) {
// This is needed or else there is a bug when switching from the 3rd or 2nd tab to first. no idea why.
Text("")
.id("what")
contentTimelineView(filter: FilterState.posts.filter)
.tag(FilterState.posts)
.id(FilterState.posts)

View File

@@ -37,6 +37,10 @@ struct NotificationsView: View {
var body: some View {
TabView(selection: $filter_state) {
// This is needed or else there is a bug when switching from the 3rd or 2nd tab to first. no idea why.
Text("")
.id("what")
NotificationTab(NotificationFilterState.all)
.tag(NotificationFilterState.all)