From 1320ff6bec8fae0c03cdb66fba9d629b493e9cfe Mon Sep 17 00:00:00 2001 From: William Casarin Date: Tue, 11 Apr 2023 14:52:11 -0700 Subject: [PATCH] Fix tabs sometimes not switching This is the dumbest code I've ever written Changelog-Fixed: Fix tabs sometimes not switching --- damus/ContentView.swift | 3 +++ damus/Views/Notifications/NotificationsView.swift | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/damus/ContentView.swift b/damus/ContentView.swift index b74db792..a8ace059 100644 --- a/damus/ContentView.swift +++ b/damus/ContentView.swift @@ -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) diff --git a/damus/Views/Notifications/NotificationsView.swift b/damus/Views/Notifications/NotificationsView.swift index c7c54452..4ead4fbd 100644 --- a/damus/Views/Notifications/NotificationsView.swift +++ b/damus/Views/Notifications/NotificationsView.swift @@ -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)