From 6c7550286b5f505e9dfe8ca63c62fa1db1b60b2e Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Mon, 25 Jul 2022 22:41:05 +0500 Subject: [PATCH] feat: prevent user from leaving studio page when there are unsaved changes --- web/src/components/tree.tsx | 2 +- web/src/containers/Studio/editor.tsx | 7 ++++++ web/src/utils/usePrompt.ts | 36 ++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 web/src/utils/usePrompt.ts diff --git a/web/src/components/tree.tsx b/web/src/components/tree.tsx index c154d76..1e3f4b0 100644 --- a/web/src/components/tree.tsx +++ b/web/src/components/tree.tsx @@ -33,7 +33,7 @@ const TreeView = ({