Fix import and export too early bug
This commit is contained in:
parent
982d2daa11
commit
364866a70a
@ -797,6 +797,7 @@ export default function ControlPanel(props) {
|
|||||||
saveAs(blob, `${exportData.filename}.${exportData.extension}`);
|
saveAs(blob, `${exportData.filename}.${exportData.extension}`);
|
||||||
} else if (visible === MODAL.IMPORT) {
|
} else if (visible === MODAL.IMPORT) {
|
||||||
if (error.type !== ERROR.ERROR) {
|
if (error.type !== ERROR.ERROR) {
|
||||||
|
setSettings((prev) => ({ ...prev, pan: { x: 0, y: 0 } }));
|
||||||
overwriteDiagram();
|
overwriteDiagram();
|
||||||
setData(null);
|
setData(null);
|
||||||
setVisible(MODAL.NONE);
|
setVisible(MODAL.NONE);
|
||||||
@ -819,7 +820,13 @@ export default function ControlPanel(props) {
|
|||||||
centered
|
centered
|
||||||
closeOnEsc={true}
|
closeOnEsc={true}
|
||||||
okText={`${visible === MODAL.IMPORT ? "Import" : "Export"}`}
|
okText={`${visible === MODAL.IMPORT ? "Import" : "Export"}`}
|
||||||
okButtonProps={{ disabled: error.type === ERROR.ERROR }}
|
okButtonProps={{
|
||||||
|
disabled:
|
||||||
|
(visible === MODAL.IMPORT &&
|
||||||
|
(error.type === ERROR.ERROR || !data)) ||
|
||||||
|
((visible === MODAL.IMG || visible === MODAL.CODE) &&
|
||||||
|
!exportData.data),
|
||||||
|
}}
|
||||||
cancelText="Cancel"
|
cancelText="Cancel"
|
||||||
width={520}
|
width={520}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user