DetailedBolusInfoStorage: Add key_ prefix

This commit is contained in:
jbr7rr 2023-08-09 13:12:46 +02:00
parent 863ad1d1ac
commit 9b95445fe6
2 changed files with 3 additions and 3 deletions

View file

@ -78,11 +78,11 @@ class DetailedBolusInfoStorageImpl @Inject constructor(
lastTwoEntries = ArrayList(store.subList(store.size - 2, store.size))
}
val jsonString = Gson().toJson(lastTwoEntries)
sp.putString(rh.gs(R.string.bolus_storage), jsonString)
sp.putString(rh.gs(R.string.key_bolus_storage), jsonString)
}
private fun loadStore(): ArrayList<DetailedBolusInfo> {
val jsonString = sp.getString(rh.gs(R.string.bolus_storage), "")
val jsonString = sp.getString(rh.gs(R.string.key_bolus_storage), "")
return if (jsonString != null && jsonString.isNotEmpty()) {
val type = object : TypeToken<List<DetailedBolusInfo>>() {}.type
Gson().fromJson(jsonString, type)

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="bolus_storage" translatable="false">bolus_storage</string>
<string name="key_bolus_storage" translatable="false">key_bolus_storage</string>
<string name="bg_label">BG</string>
<string name="executing_right_now">Command is executed right now</string>