From df509e9143e5ba095d3de6fa91a47ab603d99153 Mon Sep 17 00:00:00 2001
From: Neta London <67196883+netalondon@users.noreply.github.com>
Date: Sat, 6 Apr 2024 20:02:41 +0300
Subject: [PATCH] Move file-reset comfirmation message to a dialog (#261)
Move reset files comfirmation to dialog
---
web/src/shell/settings.tsx | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/web/src/shell/settings.tsx b/web/src/shell/settings.tsx
index 52e769810..9a87339eb 100644
--- a/web/src/shell/settings.tsx
+++ b/web/src/shell/settings.tsx
@@ -31,6 +31,7 @@ export const Settings = () => {
}, [fs, writeLocale]);
const resetWarning = useDialog();
+ const resetConfirm = useDialog();
const resetFiles = async () => {
const version = getVersion();
@@ -39,7 +40,6 @@ export const Settings = () => {
localStorage["/chip/project"] = "01";
localStorage["/chip/chip"] = "Not";
await loaders.resetFiles(fs);
- setStatus("Your files were reset");
};
const resetWarningDialog = (
@@ -63,6 +63,7 @@ export const Settings = () => {
onClick={async () => {
await resetFiles();
resetWarning.close();
+ resetConfirm.open();
}}
>
Yes
@@ -81,6 +82,17 @@ export const Settings = () => {
);
+ const resetConfirmDialog = (
+
+ );
+
return (
<>
{resetWarningDialog}
+ {resetConfirmDialog}
>
);
- // dt("Numeric Format"),
- // dd(
- // ButtonBar({
- // value: "B",
- // values: ["B", "D", "X", "A"],
- // events: {
- // onSelect: () => {},
- // },
- // })
- // )
};