From 192e5dc063a0f7850a8adb89f582589a61f00390 Mon Sep 17 00:00:00 2001 From: mcarare Date: Wed, 30 Sep 2020 17:59:51 +0300 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/15535: hasOpenTabs now considers the selected tab mode in tray tab. --- .../java/org/mozilla/fenix/tabtray/TabTrayView.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt index 5ef4429f3f..924496c43e 100644 --- a/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt +++ b/app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt @@ -213,9 +213,15 @@ class TabTrayView( tabTrayItemMenu = TabTrayItemMenu( - view.context, - { tabs.isNotEmpty() && view.tab_layout.selectedTabPosition == 0 }, - { tabs.isNotEmpty() }) { + context = view.context, + shouldShowSaveToCollection = { tabs.isNotEmpty() && view.tab_layout.selectedTabPosition == 0 }, + hasOpenTabs = { + if (isPrivateModeSelected) { + view.context.components.core.store.state.privateTabs.isNotEmpty() + } else { + view.context.components.core.store.state.normalTabs.isNotEmpty() + } + }) { when (it) { is TabTrayItemMenu.Item.ShareAllTabs -> interactor.onShareTabsClicked( isPrivateModeSelected