Show accountname on logout-button (IOS-14)

This commit is contained in:
Nathan Mattes 2023-06-28 11:12:11 +02:00
parent a27cb88400
commit 3c9648e52f
4 changed files with 9 additions and 6 deletions

View File

@ -537,13 +537,17 @@ private extension SceneCoordinator {
activityViewController.popoverPresentationController?.barButtonItem = barButtonItem activityViewController.popoverPresentationController?.barButtonItem = barButtonItem
viewController = activityViewController viewController = activityViewController
case .settings: case .settings:
guard let presentedOn = sender else { return nil } guard let presentedOn = sender,
let accountName = authContext?.mastodonAuthenticationBox.authenticationRecord.object(in: appContext.managedObjectContext)?.username
else { return nil }
let settingsCoordinator = SettingsCoordinator(presentedOn: presentedOn) let settingsCoordinator = SettingsCoordinator(presentedOn: presentedOn, accountName: accountName)
settingsCoordinator.delegate = self settingsCoordinator.delegate = self
settingsCoordinator.start() settingsCoordinator.start()
viewController = settingsCoordinator.navigationController viewController = settingsCoordinator.navigationController
childCoordinator = settingsCoordinator childCoordinator = settingsCoordinator
case .editStatus(let viewModel): case .editStatus(let viewModel):
let composeViewController = ComposeViewController(viewModel: viewModel) let composeViewController = ComposeViewController(viewModel: viewModel)
viewController = composeViewController viewController = composeViewController

View File

@ -16,7 +16,6 @@ enum AboutSettingsEntry: Hashable {
var text: String { var text: String {
switch self { switch self {
//TODO: @zeitschlag Add Localization
case .evenMoreSettings: case .evenMoreSettings:
return L10n.Scene.Settings.AboutMastodon.moreSettings return L10n.Scene.Settings.AboutMastodon.moreSettings
case .contributeToMastodon: case .contributeToMastodon:

View File

@ -46,12 +46,12 @@ class SettingsViewController: UIViewController {
self.tableViewDataSource = tableViewDataSource self.tableViewDataSource = tableViewDataSource
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(SettingsViewController.done(_:))) navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(SettingsViewController.done(_:)))
view.backgroundColor = .systemGroupedBackground view.backgroundColor = .systemGroupedBackground
view.addSubview(tableView) view.addSubview(tableView)
title = "Settings" title = L10n.Scene.Settings.Overview.title
tableView.pinToParent() tableView.pinToParent()
} }