diff --git a/eml-client/src-tauri/capabilities/migrated.json b/eml-client/src-tauri/capabilities/migrated.json index 918b68c..0bcdc12 100644 --- a/eml-client/src-tauri/capabilities/migrated.json +++ b/eml-client/src-tauri/capabilities/migrated.json @@ -11,7 +11,8 @@ "resources:default", "menu:default", "tray:default", - "shell:allow-open", - "dialog:allow-open" + "dialog:allow-open", + "dialog:allow-save", + "fs:allow-app-write" ] } diff --git a/eml-client/src/components/EmlAttachment.svelte b/eml-client/src/components/EmlAttachment.svelte index 49e26cd..3b3f5a7 100644 --- a/eml-client/src/components/EmlAttachment.svelte +++ b/eml-client/src/components/EmlAttachment.svelte @@ -36,22 +36,9 @@ defaultPath: `${downloadDir}/${part.filename}`, }), ) - .then((selectedPath) => path - .homeDir() - .then((homeDir) => selectedPath?.replace(new RegExp(`^${homeDir}`), ""), - ), - ) .then((path) => { if (path) { - return fs.writeBinaryFile( - { - contents: part.content_encoded, - path, - }, - { - dir: 11, - }, - ) + return fs.writeFile(path, part.content_encoded) } // Else cancelled, that's ok })