From 8527b29e50cef817c81184e1053ca2b884acc1f1 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Mon, 8 Jun 2020 17:19:17 +0530 Subject: [PATCH] Bug: rightPanelButton and fixed space is getting added multiple times, if additionalRightButtonsForViewController method is called multiple times. Solution: putting a check, if rightPanelButton is already part of additionalRightButtonsForViewController, then no need to add it again. --- .../SplitViewController/MVMCoreUISplitViewController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m index 1e04d987..b749ab4a 100644 --- a/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m +++ b/MVMCoreUI/Containers/SplitViewController/MVMCoreUISplitViewController.m @@ -407,10 +407,10 @@ CGFloat const PanelAnimationDuration = 0.2; - (void)setRightNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended { NSMutableArray *navigationItems = [[NSMutableArray alloc] init]; - if ((accessible && !extended) && self.rightPanelButton) { + NSArray *extraButtons = [self additionalRightButtonsForViewController:viewController]; + if ((accessible && !extended) && self.rightPanelButton && ![extraButtons containsObject:self.rightPanelButton]) { [navigationItems addObject:self.rightPanelButton]; } - NSArray *extraButtons = [self additionalRightButtonsForViewController:viewController]; if (extraButtons) { [navigationItems addObjectsFromArray:extraButtons]; }