From c6a7c2cfd6178b87d26f2a2801d1dee3a13a8752 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Mon, 29 Mar 2021 18:00:08 +0700 Subject: [PATCH] #58 added change check on dialog --- src/containers/dialogs/EditorDialog/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/dialogs/EditorDialog/index.tsx b/src/containers/dialogs/EditorDialog/index.tsx index f173207c..8de9fa8e 100644 --- a/src/containers/dialogs/EditorDialog/index.tsx +++ b/src/containers/dialogs/EditorDialog/index.tsx @@ -27,7 +27,7 @@ const EditorDialog: FC = ({ node, onRequestClose }) => { const component = useMemo(() => node.type && prop(node.type, NODE_EDITORS), [node.type]); const onClose = useCallback(() => { - if (!window.confirm('Точно выйти?')) { + if (dirty && !window.confirm('Точно выйти?')) { return undefined; }