Skip to content

Commit

Permalink
Closes mozilla-mobile#25942: hide navigation buttons from synced hist…
Browse files Browse the repository at this point in the history
…ory empty state
  • Loading branch information
mike a committed Jul 26, 2022
1 parent e33c10a commit cfecd1a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class HistoryView(
val interactor: HistoryInteractor,
val onZeroItemsLoaded: () -> Unit,
val onEmptyStateChanged: (Boolean) -> Unit,
val isSyncedHistory: Boolean
val isSyncedHistory: Boolean,
) : LibraryPageView(container), UserInteractionHandler {

val binding = ComponentHistoryBinding.inflate(
Expand Down Expand Up @@ -123,7 +123,7 @@ class HistoryView(
private fun updateEmptyState(userHasHistory: Boolean) {
binding.historyList.isInvisible = !userHasHistory
binding.historyEmptyView.isVisible = !userHasHistory
binding.topSpacer.isVisible = !userHasHistory
binding.topSpacer.isVisible = !isSyncedHistory && !userHasHistory

with(binding.recentlyClosedNavEmpty) {
recentlyClosedNav.setOnClickListener {
Expand All @@ -140,14 +140,15 @@ class HistoryView(
),
numRecentTabs
)
recentlyClosedNav.isVisible = !userHasHistory
recentlyClosedNav.isVisible = !isSyncedHistory && !userHasHistory
}

with(binding.syncedHistoryNavEmpty) {
syncedHistoryNav.setOnClickListener {
interactor.onSyncedHistoryClicked()
}
syncedHistoryNav.isVisible = FeatureFlags.showSyncedHistory && !userHasHistory
syncedHistoryNav.isVisible =
!isSyncedHistory && FeatureFlags.showSyncedHistory && !userHasHistory
}

if (!userHasHistory) {
Expand Down

0 comments on commit cfecd1a

Please sign in to comment.