Fix RecentlyUsed migration

This commit is contained in:
Rocka 2025-07-29 00:11:22 +08:00
parent b5d12c8847
commit 8a9a7130d2
No known key found for this signature in database
GPG Key ID: 28031158FFDD6853

View File

@ -60,6 +60,10 @@ class RecentlyUsed(val type: String, val limit: Int) {
if (file.exists()) {
try {
val lines = file.readLines()
// save to sharedPreferences before deleting old file
sharedPreferences.edit {
putString(type, Json.encodeToString<List<String>>(lines))
}
file.delete()
if (dir.list()?.isEmpty() == true) {
dir.delete()