Save the value for showing the initial autofill dialog (#916)

This commit is contained in:
Oleg Semenenko
2024-01-31 19:28:32 -06:00
committed by Álison Fernandes
parent ca0a38d3fa
commit 794b68d364
7 changed files with 95 additions and 0 deletions

View File

@@ -18,6 +18,11 @@ interface SettingsDiskSource {
*/
var appLanguage: AppLanguage?
/**
* Has the initial autofill dialog been shown to the user.
*/
var initialAutofillDialogShown: Boolean?
/**
* The currently persisted app theme (or `null` if not set).
*/

View File

@@ -32,6 +32,7 @@ private const val SYSTEM_BIOMETRIC_INTEGRITY_SOURCE_KEY = "$BASE_KEY:biometricIn
private const val ACCOUNT_BIOMETRIC_INTEGRITY_VALID_KEY = "$BASE_KEY:accountBiometricIntegrityValid"
private const val CRASH_LOGGING_ENABLED_KEY = "$BASE_KEY:crashLoggingEnabled"
private const val CLEAR_CLIPBOARD_INTERVAL_KEY = "$BASE_KEY:clearClipboard"
private const val INITIAL_AUTOFILL_DIALOG_SHOWN = "$BASE_KEY:addSitePromptShown"
/**
* Primary implementation of [SettingsDiskSource].
@@ -77,6 +78,15 @@ class SettingsDiskSourceImpl(
)
}
override var initialAutofillDialogShown: Boolean?
get() = getBoolean(key = INITIAL_AUTOFILL_DIALOG_SHOWN)
set(value) {
putBoolean(
key = INITIAL_AUTOFILL_DIALOG_SHOWN,
value = value,
)
}
override var systemBiometricIntegritySource: String?
get() = getString(key = SYSTEM_BIOMETRIC_INTEGRITY_SOURCE_KEY)
set(value) {

View File

@@ -32,6 +32,11 @@ interface SettingsRepository {
*/
val appThemeStateFlow: StateFlow<AppTheme>
/**
* Has the initial autofill dialog been shown to the user.
*/
var initialAutofillDialogShown: Boolean
/**
* The currently stored last time the vault was synced.
*/

View File

@@ -65,6 +65,12 @@ class SettingsRepositoryImpl(
initialValue = settingsDiskSource.appTheme,
)
override var initialAutofillDialogShown: Boolean
get() = settingsDiskSource.initialAutofillDialogShown ?: false
set(value) {
settingsDiskSource.initialAutofillDialogShown = value
}
override var vaultLastSync: Instant?
get() = vaultLastSyncStateFlow.value
set(value) {