Skip to content

Commit 1888b89

Browse files
authored
Merge pull request #291 from mumu-lhl/feat/remove-cached-dictionaries-on-android
feat: delete associated .mdx and .mdd files on dictionary removal for…
2 parents d0cd1f0 + 2c1e275 commit 1888b89

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/dictionary.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,16 @@ class Mdict {
259259
await file.delete();
260260

261261
await dictionaryListDao.remove(path);
262+
263+
if (Platform.isAndroid) {
264+
final mdxFile = File("$path.mdx");
265+
await mdxFile.delete();
266+
267+
final mddFile = File("$path.mdd");
268+
if (await mddFile.exists()) {
269+
await mddFile.delete();
270+
}
271+
}
262272
}
263273

264274
void setDefaultTitle() {

0 commit comments

Comments
 (0)