mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
combine into single if
This commit is contained in:
parent
89c3508fd5
commit
0d564bcf05
1 changed files with 12 additions and 16 deletions
|
@ -1777,25 +1777,21 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.setState({ errorMessage: error.message });
|
||||
});
|
||||
|
||||
if (fileHandle && isImageFileHandle(fileHandle)) {
|
||||
if (type === "clipboard" || (fileHandle && isImageFileHandle(fileHandle))) {
|
||||
this.setState({
|
||||
fileHandle: this.state.exportEmbedScene ? fileHandle : null,
|
||||
fileHandle:
|
||||
fileHandle && this.state.exportEmbedScene ? fileHandle : null,
|
||||
openDialog: null,
|
||||
toast: {
|
||||
message: fileHandle?.name
|
||||
? t("toast.fileSavedToFilename").replace(
|
||||
"{filename}",
|
||||
`"${fileHandle.name}"`,
|
||||
)
|
||||
: t("toast.fileSaved"),
|
||||
duration: 1500,
|
||||
},
|
||||
});
|
||||
} else if (type === "clipboard") {
|
||||
this.setState({
|
||||
openDialog: null,
|
||||
toast: {
|
||||
message: t("toast.copyToClipboard"),
|
||||
message:
|
||||
type === "clipboard"
|
||||
? t("toast.copyToClipboard")
|
||||
: fileHandle?.name
|
||||
? t("toast.fileSavedToFilename").replace(
|
||||
"{filename}",
|
||||
`"${fileHandle.name}"`,
|
||||
)
|
||||
: t("toast.fileSaved"),
|
||||
duration: 1500,
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue