wip: multi account

This commit is contained in:
Ren Amamiya
2023-09-28 13:58:50 +07:00
parent 0e6fc65b08
commit 4f4e2f5ccd
11 changed files with 59 additions and 30 deletions

View File

@@ -24,7 +24,7 @@ export default function App() {
const accountLoader = async () => {
try {
const account = await db.checkAccount();
const totalAccount = await db.checkAccount();
const stronghold = sessionStorage.getItem('stronghold');
const privkey = JSON.parse(stronghold).state.privkey || null;
@@ -32,7 +32,7 @@ export default function App() {
const onboarding = localStorage.getItem('onboarding');
const step = JSON.parse(onboarding).state.step || null;
if (!account) {
if (totalAccount === 0) {
return redirect('/auth/welcome');
} else {
if (step) {
@@ -251,6 +251,13 @@ export default function App() {
return { Component: UnlockScreen };
},
},
{
path: 'lock',
async lazy() {
const { LockScreen } = await import('@app/auth/lock');
return { Component: LockScreen };
},
},
{
path: 'migrate',
async lazy() {