always save result as png

This commit is contained in:
Qing
2023-12-28 11:14:42 +08:00
parent cfb43a4805
commit 92ecd53232
3 changed files with 20 additions and 8 deletions

View File

@@ -501,13 +501,17 @@ export default function Editor(props: EditorProps) {
}
)
function download() {
const download = async () => {
if (file === undefined) {
return
}
if (enableAutoSaving && renders.length > 0) {
try {
downloadToOutput(renders[renders.length - 1], file.name, file.type)
await downloadToOutput(
renders[renders.length - 1],
file.name,
file.type
)
toast({
description: "Save image success",
})