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

@ -17,16 +17,10 @@ jobs:
settings:
- platform: 'macos-latest'
args: '--target universal-apple-darwin'
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'ubuntu-20.04'
args: ''
- platform: 'windows-latest'
args: '--target x86_64-pc-windows-msvc'
- platform: 'windows-latest'
args: '--target i686-pc-windows-msvc'
runs-on: ${{ matrix.settings.platform }}
steps:
- uses: actions/checkout@v3

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 {