update gh action and fix migrate page

This commit is contained in:
Ren Amamiya
2023-07-10 15:30:15 +07:00
parent 2a4c3dd7c8
commit c664b3e4a4
2 changed files with 4 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
import { useQueryClient } from '@tanstack/react-query';
import { useState } from 'react';
import { Resolver, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
@@ -30,6 +31,7 @@ const resolver: Resolver<FormValues> = async (values) => {
};
export function MigrateScreen() {
const queryClient = useQueryClient();
const navigate = useNavigate();
const [passwordInput, setPasswordInput] = useState('password');
@@ -76,6 +78,8 @@ export function MigrateScreen() {
// load private in secure storage
try {
await save(account.pubkey, account.privkey, data.password);
// clear cache
await queryClient.invalidateQueries(['currentAccount']);
// redirect to home
navigate('/', { replace: true });
} catch {