From 9184ec4ecfd39cf711ad4e2fb6da897114fa4ee9 Mon Sep 17 00:00:00 2001 From: CMK Date: Fri, 9 Apr 2021 17:46:20 +0800 Subject: [PATCH] fix: combine event consumed issue --- .../Scene/Profile/ProfileViewController.swift | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Mastodon/Scene/Profile/ProfileViewController.swift b/Mastodon/Scene/Profile/ProfileViewController.swift index 75bd04dc9..9819f3f18 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -150,7 +150,13 @@ extension ProfileViewController { viewModel.isEditing.eraseToAnyPublisher(), viewModel.isUpdating.eraseToAnyPublisher() ) - .share() + // note: not add .share() here + + let barButtonItemHiddenPublisher = Publishers.CombineLatest3( + viewModel.isMeBarButtonItemsHidden.eraseToAnyPublisher(), + viewModel.isReplyBarButtonItemHidden.eraseToAnyPublisher(), + viewModel.isMoreMenuBarButtonItemHidden.eraseToAnyPublisher() + ) editingAndUpdatingPublisher .receive(on: DispatchQueue.main) @@ -159,13 +165,6 @@ extension ProfileViewController { self.cancelEditingBarButtonItem.isEnabled = !isUpdating } .store(in: &disposeBag) - - let barButtonItemHiddenPublisher = Publishers.CombineLatest3( - viewModel.isMeBarButtonItemsHidden.eraseToAnyPublisher(), - viewModel.isReplyBarButtonItemHidden.eraseToAnyPublisher(), - viewModel.isMoreMenuBarButtonItemHidden.eraseToAnyPublisher() - ) - .share() Publishers.CombineLatest3 ( viewModel.suspended.eraseToAnyPublisher(),