Skip to content

Commit 3448b39

Browse files
authored
Merge branch 'ChatGPTNextWeb:main' into main
2 parents 32099bf + ff9f0e6 commit 3448b39

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ declare interface Window {
1919
};
2020
fs: {
2121
writeBinaryFile(path: string, data: Uint8Array): Promise<void>;
22+
writeTextFile(path: string, data: string): Promise<void>;
2223
};
2324
notification:{
2425
requestPermission(): Promise<Permission>;

app/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ export async function downloadAs(text: string, filename: string) {
5757

5858
if (result !== null) {
5959
try {
60-
await window.__TAURI__.fs.writeBinaryFile(
60+
await window.__TAURI__.fs.writeTextFile(
6161
result,
62-
new Uint8Array([...text].map((c) => c.charCodeAt(0))),
62+
text
6363
);
6464
showToast(Locale.Download.Success);
6565
} catch (error) {

0 commit comments

Comments
 (0)