From 5bdb13071c40854ad78aa3007c9c581c52b016e4 Mon Sep 17 00:00:00 2001 From: brusher_ru Date: Wed, 18 Sep 2024 15:25:02 -0300 Subject: [PATCH 1/2] fix: change "Importing..." to "Import" back in case of error --- src/screens/welcome/ImportScreen.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screens/welcome/ImportScreen.tsx b/src/screens/welcome/ImportScreen.tsx index 360b7ee..86c1c07 100644 --- a/src/screens/welcome/ImportScreen.tsx +++ b/src/screens/welcome/ImportScreen.tsx @@ -85,11 +85,11 @@ function ImportScreen(): JSX.Element { () => openWallet(walletFileContent, password), 1 ); + setIsLoading(false); if (!success) { setError('password', { type: 'value', message: 'Invalid password' }); return; } - setIsLoading(false); navigate('/wallet'); }); From 85c253f83a0c2eb881017b9bf8700493ca068a77 Mon Sep 17 00:00:00 2001 From: brusher_ru Date: Wed, 18 Sep 2024 15:25:30 -0300 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20sometime=20PasswordAlert=20throws=20?= =?UTF-8?q?an=20error=20(race=20cond)=20=E2=80=94=20don't=20render=20it=20?= =?UTF-8?q?instead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PasswordAlert.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/PasswordAlert.tsx b/src/components/PasswordAlert.tsx index c653d8a..209081d 100644 --- a/src/components/PasswordAlert.tsx +++ b/src/components/PasswordAlert.tsx @@ -20,12 +20,12 @@ import usePassword from '../store/usePassword'; import PasswordInput from './PasswordInput'; -function PasswordAlert(): JSX.Element { +function PasswordAlert(): JSX.Element | null { const [isLoading, setIsLoading] = useState(false); const { form } = usePassword(); const cancelRef = useRef(null); if (!form.register.password || !form.register.remember) { - throw new Error('PasswordAlert: password or remember is not registered'); + return null; } const onSubmit = async () => {