diff --git a/app/global.d.ts b/app/global.d.ts index e0a2c3f0686..31e2b6e8a84 100644 --- a/app/global.d.ts +++ b/app/global.d.ts @@ -19,6 +19,7 @@ declare interface Window { }; fs: { writeBinaryFile(path: string, data: Uint8Array): Promise; + writeTextFile(path: string, data: string): Promise; }; notification:{ requestPermission(): Promise; diff --git a/app/utils.ts b/app/utils.ts index b484e83864b..8b755afeac1 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -57,9 +57,9 @@ export async function downloadAs(text: string, filename: string) { if (result !== null) { try { - await window.__TAURI__.fs.writeBinaryFile( + await window.__TAURI__.fs.writeTextFile( result, - new Uint8Array([...text].map((c) => c.charCodeAt(0))), + text ); showToast(Locale.Download.Success); } catch (error) {