This commit is contained in:
Justin Mazzocchi 2020-12-06 12:07:22 -08:00
parent 0416edc083
commit fc1104c951
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C

View file

@ -10,17 +10,17 @@ class ShareExtensionNavigationViewController: UINavigationController {
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
let vm: NewStatusViewModel
let viewModel: NewStatusViewModel
do {
vm = try newStatusViewModel()
viewModel = try newStatusViewModel()
} catch {
setViewControllers([ShareErrorViewController(error: error)], animated: false)
return
}
setViewControllers([NewStatusViewController(viewModel: vm)], animated: false)
setViewControllers([NewStatusViewController(viewModel: viewModel)], animated: false)
}
@available(*, unavailable)
@ -36,14 +36,14 @@ private extension ShareExtensionNavigationViewController {
reduceMotion: { UIAccessibility.isReduceMotionEnabled })
let allIdentitiesService = try AllIdentitiesService(environment: environment)
var id: Identity.Id?
var recentId: Identity.Id?
_ = allIdentitiesService.immediateMostRecentlyUsedIdentityIdPublisher()
.sink { _ in } receiveValue: { id = $0 }
.sink { _ in } receiveValue: { recentId = $0 }
guard let idd = id else { throw ShareExtensionError.noAccountFound }
guard let id = recentId else { throw ShareExtensionError.noAccountFound }
let newStatusService = try allIdentitiesService.identityService(id: idd).newStatusService()
let newStatusService = try allIdentitiesService.identityService(id: id).newStatusService()
return NewStatusViewModel(service: newStatusService)
}