Skip to content

Commit

Permalink
Fix navigation for profile user and talk pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisevener committed Nov 8, 2024
1 parent 692eb11 commit 5a5067b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Wikipedia/Code/ProfileCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ final class ProfileCoordinator: NSObject, Coordinator, ProfileCoordinatorDelegat
private var donateCoordinator: DonateCoordinator?
private let yirCoordinator: YearInReviewCoordinator

let username: String?
let sourcePage: ProfileCoordinatorSource


Expand All @@ -48,7 +47,6 @@ final class ProfileCoordinator: NSObject, Coordinator, ProfileCoordinatorDelegat
self.theme = theme
self.donateSouce = donateSouce
self.dataStore = dataStore
self.username = dataStore.authenticationManager.authStatePermanentUsername
self.delegate = logoutDelegate
self.sourcePage = sourcePage
self.yirCoordinator = yirCoordinator
Expand All @@ -57,6 +55,7 @@ final class ProfileCoordinator: NSObject, Coordinator, ProfileCoordinatorDelegat
// MARK: Coordinator Protocol Methods

@objc func start() {
let username = dataStore.authenticationManager.authStatePermanentUsername
let isLoggedIn = dataStore.authenticationManager.authStateIsPermanent

let pageTitle = WMFLocalizedString("profile-page-title-logged-out", value: "Account", comment: "Page title for non-logged in users")
Expand Down Expand Up @@ -197,13 +196,15 @@ final class ProfileCoordinator: NSObject, Coordinator, ProfileCoordinatorDelegat


private func showUserPage() {
let username = dataStore.authenticationManager.authStatePermanentUsername
if let username, let siteURL = dataStore.primarySiteURL {
let userPageCoordinator = UserPageCoordinator(navigationController: navigationController, theme: theme, username: username, siteURL: siteURL)
userPageCoordinator.start()
}
}

private func showUserTalkPage() {
let username = dataStore.authenticationManager.authStatePermanentUsername
if let siteURL = dataStore.primarySiteURL, let username {
let userTalkCoordinator = UserTalkCoordinator(navigationController: navigationController, theme: theme, username: username, siteURL: siteURL, dataStore: dataStore)
userTalkCoordinator.start()
Expand Down

0 comments on commit 5a5067b

Please sign in to comment.