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
@@ -57,6 +57,10 @@ object RecentsCache {
.edit().putString(KEY, arr.toString()).apply()
}
fun clear(context: Context) {
context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).edit().clear().apply()
}
fun load(context: Context): List<RecentPick> {
val json = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
.getString(KEY, null) ?: return emptyList()