Skip to content

Commit

Permalink
For mozilla-mobile#15535: hasOpenTabs now considers the selected tab …
Browse files Browse the repository at this point in the history
…mode in tray tab.
  • Loading branch information
mcarare authored and ekager committed Sep 30, 2020
1 parent cd6ab45 commit 19b377c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/src/main/java/org/mozilla/fenix/tabtray/TabTrayView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 19b377c

Please sign in to comment.