Fix "Riot is now Element" dialog displayed by mistake, after a logout

This commit is contained in:
Benoit Marty 2020-11-03 18:48:36 +01:00 committed by Benoit Marty
parent fd4b56572d
commit ea4e9b8e5e
2 changed files with 5 additions and 1 deletions

View file

@ -28,7 +28,7 @@ import im.vector.app.features.settings.VectorSettingsUrls
// Increase this value to show again the disclaimer dialog after an upgrade of the application
private const val CURRENT_DISCLAIMER_VALUE = 2
private const val SHARED_PREF_KEY = "LAST_DISCLAIMER_VERSION_VALUE"
const val SHARED_PREF_KEY = "LAST_DISCLAIMER_VERSION_VALUE"
fun showDisclaimerDialog(activity: Activity) {
val sharedPrefs = DefaultSharedPreferences.getInstance(activity)

View file

@ -24,6 +24,7 @@ import com.squareup.seismic.ShakeDetector
import im.vector.app.BuildConfig
import im.vector.app.R
import im.vector.app.core.di.DefaultSharedPreferences
import im.vector.app.features.disclaimer.SHARED_PREF_KEY
import im.vector.app.features.homeserver.ServerUrlsRepository
import im.vector.app.features.themes.ThemeUtils
import org.matrix.android.sdk.api.extensions.tryOrNull
@ -248,6 +249,9 @@ class VectorPreferences @Inject constructor(private val context: Context) {
// theme
keysToKeep.add(ThemeUtils.APPLICATION_THEME_KEY)
// Disclaimer dialog
keysToKeep.add(SHARED_PREF_KEY)
// get all the existing keys
val keys = defaultPrefs.all.keys