fixed bug where the context menu for CompositionView.changeIdentityButton didn't update properly after changing identity

This commit is contained in:
Amit Ron 2022-11-09 19:36:31 +02:00
parent 9310d281ce
commit 36d58ab99a

View file

@ -203,11 +203,14 @@ private extension CompositionView {
self.changeIdentityButton.accessibilityLabel = $0.identity.handle self.changeIdentityButton.accessibilityLabel = $0.identity.handle
self.changeIdentityButton.accessibilityHint = self.changeIdentityButton.accessibilityHint =
NSLocalizedString("compose.change-identity-button.accessibility-hint", comment: "") NSLocalizedString("compose.change-identity-button.accessibility-hint", comment: "")
}
.store(in: &cancellables)
parentViewModel.identityContext.$authenticatedOtherIdentities $0.$authenticatedOtherIdentities
.sink { [weak self] in self?.changeIdentityButton.menu = self?.changeIdentityMenu(identities: $0) } .sink { [weak self] authenticatedOtherIdentities in
self?.changeIdentityButton.menu =
self?.changeIdentityMenu(identities: authenticatedOtherIdentities)
}
.store(in: &self.cancellables)
}
.store(in: &cancellables) .store(in: &cancellables)
viewModel.$attachmentViewModels viewModel.$attachmentViewModels