mirror of
https://github.com/fcitx5-android/fcitx5-android.git
synced 2026-08-02 20:16:06 +08:00
Fix RecentlyUsed migration
This commit is contained in:
parent
b5d12c8847
commit
8a9a7130d2
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user