Skip to content

Commit

Permalink
Merge pull request #95 from spacemeshos/fix-92-importing-btn
Browse files Browse the repository at this point in the history
Fix "Import button get stuck"
  • Loading branch information
brusherru authored Sep 19, 2024
2 parents c1e5287 + 85c253f commit 8dff7ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/PasswordAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLButtonElement>(null);
if (!form.register.password || !form.register.remember) {
throw new Error('PasswordAlert: password or remember is not registered');
return null;
}

const onSubmit = async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/welcome/ImportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down

0 comments on commit 8dff7ba

Please sign in to comment.