Skip to content

Commit

Permalink
Fix attachment download for tauri v2
Browse files Browse the repository at this point in the history
  • Loading branch information
OJFord committed Apr 25, 2024
1 parent 677c5af commit d883e70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
5 changes: 3 additions & 2 deletions eml-client/src-tauri/capabilities/migrated.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
15 changes: 1 addition & 14 deletions eml-client/src/components/EmlAttachment.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit d883e70

Please sign in to comment.