damus

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

commit a4855775efcf275b931190f85dc999ad400bb2d3
parent 06c2741bf4637c7697bc03aef0196824c481f6c4
Author: Jack Chakany <jacany@chaker.net>
Date:   Thu, 23 Feb 2023 19:24:28 -0500

Fix navbar title so it changes based on what page you were on previously.

Diffstat:
Mdamus/ContentView.swift | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -203,7 +203,20 @@ struct ContentView: View { EmptyView() } } - .navigationBarTitle(selected_timeline == .home ? NSLocalizedString("Home", comment: "Navigation bar title for Home view where posts and replies appear from those who the user is following.") : NSLocalizedString("Universe 🛸", comment: "Navigation bar title for universal view where posts from all connected relay servers appear."), displayMode: .inline) + .navigationBarTitle({ + switch selected_timeline { + case .home: + return NSLocalizedString("Home", comment: "Navigation bar title for Home view where posts and replies appear from those who the user is following.") + case .dms: + return NSLocalizedString("DMs", comment: "Navigation bar title for DMs view, where DM is the English abbreviation for Direct Message.") + case .notifications: + return NSLocalizedString("Notifications", comment: "Navigation bar title for Notifications view.") + case .search: + return NSLocalizedString("Universe 🛸", comment: "Navigation bar title for the universal view where posts from all connected relay servers appear.") + case .none: + return NSLocalizedString("", comment: "Toolbar label for unknown views. This label would be displayed only if a new timeline view is added but a toolbar label was not explicitly assigned to it yet.") + } + }(), displayMode: .inline) .toolbar { ToolbarItem(placement: .principal) { timelineNavItem