Skip to content

Commit

Permalink
Mobile: Re-download voice typing models on URL change
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Dec 23, 2024
1 parent 40914be commit 02553bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/app-mobile/services/voiceTyping/VoiceTyping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ export default class VoiceTyping {
}

public async isDownloaded() {
return await shim.fsDriver().exists(this.getUuidPath());
const uuidPath = this.getUuidPath();
if (!await shim.fsDriver().exists(uuidPath)) return false;

const modelUrl = this.provider.getDownloadUrl(this.locale);
const urlHash = await shim.fsDriver().readFile(uuidPath);
return urlHash.trim() === md5(modelUrl);
}

public async download() {
Expand Down

0 comments on commit 02553bc

Please sign in to comment.