From 1b10d125af0cac45e9300de3ae84c43dfb6053c4 Mon Sep 17 00:00:00 2001 From: Mark Injerd Date: Wed, 4 Dec 2024 00:03:30 -0500 Subject: [PATCH] Fix shake threshold not initialized to default on first launch Regression: ff53685 --- .../java/com/pilot51/voicenotify/PreferenceHelper.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/pilot51/voicenotify/PreferenceHelper.kt b/app/src/main/java/com/pilot51/voicenotify/PreferenceHelper.kt index 61595a7..c65b5ba 100644 --- a/app/src/main/java/com/pilot51/voicenotify/PreferenceHelper.kt +++ b/app/src/main/java/com/pilot51/voicenotify/PreferenceHelper.kt @@ -145,7 +145,14 @@ object PreferenceHelper { } else { spFile.delete() } - } else settingsDao.insert(Settings.defaults) + } else { + settingsDao.insert(Settings.defaults) + dataStore.edit { prefs -> + prefs[KEY_SHAKE_THRESHOLD] = DEFAULT_SHAKE_THRESHOLD + prefs[KEY_APP_DEFAULT_ENABLE] = DEFAULT_APP_DEFAULT_ENABLE + prefs[KEY_IS_SUSPENDED] = DEFAULT_IS_SUSPENDED + } + } } fun exportBackup(uri: Uri) {