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: settings:
- platform: 'macos-latest' - platform: 'macos-latest'
args: '--target universal-apple-darwin' 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' - platform: 'ubuntu-20.04'
args: '' args: ''
- platform: 'windows-latest' - platform: 'windows-latest'
args: '--target x86_64-pc-windows-msvc' args: '--target x86_64-pc-windows-msvc'
- platform: 'windows-latest'
args: '--target i686-pc-windows-msvc'
runs-on: ${{ matrix.settings.platform }} runs-on: ${{ matrix.settings.platform }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

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