For #22034: Inactive tabs prompt is redisplayed after dismissing by turning on Auto close

upstream-sync
Arturo Mejia 3 years ago committed by mergify[bot]
parent a4bcecf8c5
commit d943be0e53

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

Loading…
Cancel
Save