From 19b377c0214099b04de3f9e5939893124722851e Mon Sep 17 00:00:00 2001 From: mcarare Date: Wed, 30 Sep 2020 17:59:51 +0300 Subject: [PATCH] For #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