For #15535: hasOpenTabs now considers the selected tab mode in tray tab.

This commit is contained in:
mcarare 2020-09-30 17:59:51 +03:00 committed by ekager
parent 07f544a28d
commit 99634f0bdb
1 changed files with 9 additions and 3 deletions

View File

@ -212,9 +212,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