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 alertController(alertController: UIAlertController)
|
||||
|
||||
#if DEBUG
|
||||
case publicTimeline
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,6 +165,12 @@ private extension SceneCoordinator {
|
|||
)
|
||||
}
|
||||
viewController = alertController
|
||||
#if DEBUG
|
||||
case .publicTimeline:
|
||||
let _viewController = PublicTimelineViewController()
|
||||
_viewController.viewModel = PublicTimelineViewModel(context: appContext)
|
||||
viewController = _viewController
|
||||
#endif
|
||||
}
|
||||
|
||||
setupDependency(for: viewController as? NeedsDependency)
|
||||
|
|
|
@ -17,6 +17,10 @@ extension HomeTimelineViewController {
|
|||
identifier: nil,
|
||||
options: .displayInline,
|
||||
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
|
||||
guard let self = self else { return }
|
||||
self.signOutAction(action)
|
||||
|
@ -29,6 +33,10 @@ extension HomeTimelineViewController {
|
|||
|
||||
extension HomeTimelineViewController {
|
||||
|
||||
@objc private func showPublicTimelineAction(_ sender: UIAction) {
|
||||
coordinator.present(scene: .publicTimeline, from: self, transition: .show)
|
||||
}
|
||||
|
||||
@objc private func signOutAction(_ sender: UIAction) {
|
||||
guard let activeMastodonAuthenticationBox = context.authenticationService.activeMastodonAuthenticationBox.value else {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue