add clear cache

This commit is contained in:
2026-05-15 12:00:59 +05:00
parent 7c0ffece35
commit e8469a8888
11 changed files with 72 additions and 0 deletions
@@ -51,6 +51,10 @@ object ContactsCache {
prefs.apply()
}
fun clear(context: Context) {
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().clear().apply()
}
fun loadContacts(context: Context): List<MibBeneficiary> {
val json = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
.getString(KEY_CONTACTS, null) ?: return emptyList()