This commit is contained in:
GH Action - Upstream Sync 2024-03-08 00:25:39 +00:00
commit a313cf7b11
2 changed files with 3 additions and 2 deletions

1
app/global.d.ts vendored
View File

@ -19,6 +19,7 @@ declare interface Window {
};
fs: {
writeBinaryFile(path: string, data: Uint8Array): Promise<void>;
writeTextFile(path: string, data: string): Promise<void>;
};
notification:{
requestPermission(): Promise<Permission>;

View File

@ -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) {