[fenix] For https://github.com/mozilla-mobile/fenix/issues/22034: Inactive tabs prompt is redisplayed after dismissing by turning on Auto close

pull/600/head
Arturo Mejia 3 years ago committed by mergify[bot]
parent a68de609c2
commit 07742ec701

@ -20,7 +20,7 @@ class InactiveTabsAutoCloseDialogController(
* Dismiss the auto-close dialog. * Dismiss the auto-close dialog.
*/ */
fun close() { fun close() {
settings.hasInactiveTabsAutoCloseDialogBeenDismissed = true markDialogAsShown()
refeshInactiveTabsSecion() refeshInactiveTabsSecion()
} }
@ -28,7 +28,7 @@ class InactiveTabsAutoCloseDialogController(
* Enable the auto-close feature with the after a month setting. * Enable the auto-close feature with the after a month setting.
*/ */
fun enableAutoClosed() { fun enableAutoClosed() {
settings.hasInactiveTabsAutoCloseDialogBeenDismissed = true markDialogAsShown()
settings.closeTabsAfterOneMonth = true settings.closeTabsAfterOneMonth = true
settings.closeTabsAfterOneWeek = false settings.closeTabsAfterOneWeek = false
settings.closeTabsAfterOneDay = false settings.closeTabsAfterOneDay = false
@ -36,6 +36,13 @@ class InactiveTabsAutoCloseDialogController(
refeshInactiveTabsSecion() refeshInactiveTabsSecion()
} }
/**
* Marks the dialog as shown and to not be displayed again.
*/
private fun markDialogAsShown() {
settings.hasInactiveTabsAutoCloseDialogBeenDismissed = true
}
@VisibleForTesting @VisibleForTesting
internal fun refeshInactiveTabsSecion() { internal fun refeshInactiveTabsSecion() {
val tabs = browserStore.state.tabs.filter(tabFilter) val tabs = browserStore.state.tabs.filter(tabFilter)

Loading…
Cancel
Save