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
viewController = activityViewController
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.start()
viewController = settingsCoordinator.navigationController
childCoordinator = settingsCoordinator
case .editStatus(let viewModel):
let composeViewController = ComposeViewController(viewModel: viewModel)
viewController = composeViewController

View File

@ -654,7 +654,7 @@ extension MainTabBarController {
@objc private func openSettingsKeyCommandHandler(_ sender: UIKeyCommand) {
guard let authContext,
let setting = context.settingService.currentSetting.value else { return }
let setting = context.settingService.currentSetting.value else { return }
_ = coordinator.present(scene: .settings, from: nil, transition: .none)
}

View File

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

View File

@ -46,12 +46,12 @@ class SettingsViewController: UIViewController {
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.addSubview(tableView)
title = "Settings"
title = L10n.Scene.Settings.Overview.title
tableView.pinToParent()
}