From d316ede233a2b90587eaa0eac457dccc120db4e6 Mon Sep 17 00:00:00 2001 From: Mathieu Sanchez Date: Sat, 25 Apr 2020 22:15:34 +0200 Subject: [PATCH] Issues-2: Correct saving Config when not existing --- .../fr/sanchezm/attestationsCovid19/data/db/dao/ConfigDao.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/data/db/dao/ConfigDao.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/data/db/dao/ConfigDao.kt index cd86a5e..eef99b9 100644 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/data/db/dao/ConfigDao.kt +++ b/app/src/main/java/fr/sanchezm/attestationsCovid19/data/db/dao/ConfigDao.kt @@ -31,10 +31,10 @@ class ConfigDao(private val savePath: String) { _config.value = Gson().fromJson(file.readText(Charsets.UTF_8), Config::class.java) _config.value?.versionCode = BuildConfig.VERSION_CODE _config.value?.versionName = BuildConfig.VERSION_NAME - save() } else { _config.value = Config(BuildConfig.DB_VERSION, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE) + save() } }