damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit ced6e2488f47e0d780777f148f9cc1ddee551054
parent 77c2abc524b9f3b903ce5380515cb3237896f024
Author: Thomas Rademaker <thomas@sparrowtek.com>
Date:   Sun, 22 Jan 2023 09:14:16 -0500

Fix duplicate post buttons when swiping tabs

Move the postButtonContainer view to avoid having 2 buttons on screen when swiping tabs

Closes: #366
Changelog-Fixed: Fix duplicate post buttons when swiping tabs

Diffstat:
Mdamus/ContentView.swift | 29++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -93,15 +93,23 @@ struct ContentView: View { var PostingTimelineView: some View { VStack { - TabView(selection: $filter_state) { - contentTimelineView(filter: FilterState.posts.filter) - .tag(FilterState.posts) - .id(FilterState.posts) - contentTimelineView(filter: FilterState.posts_and_replies.filter) - .tag(FilterState.posts_and_replies) - .id(FilterState.posts_and_replies) + ZStack { + TabView(selection: $filter_state) { + contentTimelineView(filter: FilterState.posts.filter) + .tag(FilterState.posts) + .id(FilterState.posts) + contentTimelineView(filter: FilterState.posts_and_replies.filter) + .tag(FilterState.posts_and_replies) + .id(FilterState.posts_and_replies) + } + .tabViewStyle(.page(indexDisplayMode: .never)) + + if privkey != nil { + PostButtonContainer(userSettings: user_settings) { + self.active_sheet = .post + } + } } - .tabViewStyle(.page(indexDisplayMode: .never)) } .safeAreaInset(edge: .top, spacing: 0) { VStack(spacing: 0) { @@ -120,11 +128,6 @@ struct ContentView: View { if let damus = self.damus_state { TimelineView(events: $home.events, loading: $home.loading, damus: damus, show_friend_icon: false, filter: filter) } - if privkey != nil { - PostButtonContainer(userSettings: user_settings) { - self.active_sheet = .post - } - } } }