fix: combine event consumed issue

This commit is contained in:
CMK 2021-04-09 17:46:20 +08:00
parent 4faacdf1be
commit 9184ec4ecf
1 changed files with 7 additions and 8 deletions

View File

@ -150,7 +150,13 @@ extension ProfileViewController {
viewModel.isEditing.eraseToAnyPublisher(), viewModel.isEditing.eraseToAnyPublisher(),
viewModel.isUpdating.eraseToAnyPublisher() viewModel.isUpdating.eraseToAnyPublisher()
) )
.share() // note: not add .share() here
let barButtonItemHiddenPublisher = Publishers.CombineLatest3(
viewModel.isMeBarButtonItemsHidden.eraseToAnyPublisher(),
viewModel.isReplyBarButtonItemHidden.eraseToAnyPublisher(),
viewModel.isMoreMenuBarButtonItemHidden.eraseToAnyPublisher()
)
editingAndUpdatingPublisher editingAndUpdatingPublisher
.receive(on: DispatchQueue.main) .receive(on: DispatchQueue.main)
@ -159,13 +165,6 @@ extension ProfileViewController {
self.cancelEditingBarButtonItem.isEnabled = !isUpdating self.cancelEditingBarButtonItem.isEnabled = !isUpdating
} }
.store(in: &disposeBag) .store(in: &disposeBag)
let barButtonItemHiddenPublisher = Publishers.CombineLatest3(
viewModel.isMeBarButtonItemsHidden.eraseToAnyPublisher(),
viewModel.isReplyBarButtonItemHidden.eraseToAnyPublisher(),
viewModel.isMoreMenuBarButtonItemHidden.eraseToAnyPublisher()
)
.share()
Publishers.CombineLatest3 ( Publishers.CombineLatest3 (
viewModel.suspended.eraseToAnyPublisher(), viewModel.suspended.eraseToAnyPublisher(),