feat: add public timeline debug entry
This commit is contained in:
parent
1345db9d7e
commit
ca013f79da
|
@ -45,6 +45,10 @@ extension SceneCoordinator {
|
||||||
case mastodonServerRules(viewModel: MastodonServerRulesViewModel)
|
case mastodonServerRules(viewModel: MastodonServerRulesViewModel)
|
||||||
|
|
||||||
case alertController(alertController: UIAlertController)
|
case alertController(alertController: UIAlertController)
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
case publicTimeline
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +165,12 @@ private extension SceneCoordinator {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
viewController = alertController
|
viewController = alertController
|
||||||
|
#if DEBUG
|
||||||
|
case .publicTimeline:
|
||||||
|
let _viewController = PublicTimelineViewController()
|
||||||
|
_viewController.viewModel = PublicTimelineViewModel(context: appContext)
|
||||||
|
viewController = _viewController
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
setupDependency(for: viewController as? NeedsDependency)
|
setupDependency(for: viewController as? NeedsDependency)
|
||||||
|
|
|
@ -17,6 +17,10 @@ extension HomeTimelineViewController {
|
||||||
identifier: nil,
|
identifier: nil,
|
||||||
options: .displayInline,
|
options: .displayInline,
|
||||||
children: [
|
children: [
|
||||||
|
UIAction(title: "Show Public Timeline", image: UIImage(systemName: "list.dash"), attributes: []) { [weak self] action in
|
||||||
|
guard let self = self else { return }
|
||||||
|
self.showPublicTimelineAction(action)
|
||||||
|
},
|
||||||
UIAction(title: "Sign Out", image: UIImage(systemName: "escape"), attributes: .destructive) { [weak self] action in
|
UIAction(title: "Sign Out", image: UIImage(systemName: "escape"), attributes: .destructive) { [weak self] action in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
self.signOutAction(action)
|
self.signOutAction(action)
|
||||||
|
@ -29,6 +33,10 @@ extension HomeTimelineViewController {
|
||||||
|
|
||||||
extension HomeTimelineViewController {
|
extension HomeTimelineViewController {
|
||||||
|
|
||||||
|
@objc private func showPublicTimelineAction(_ sender: UIAction) {
|
||||||
|
coordinator.present(scene: .publicTimeline, from: self, transition: .show)
|
||||||
|
}
|
||||||
|
|
||||||
@objc private func signOutAction(_ sender: UIAction) {
|
@objc private func signOutAction(_ sender: UIAction) {
|
||||||
guard let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value else {
|
guard let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value else {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue