polish splash screen

This commit is contained in:
Ren Amamiya
2023-08-14 09:34:38 +07:00
parent c42c78fc98
commit 6c6f50444e
12 changed files with 75 additions and 72 deletions

View File

@@ -15,29 +15,33 @@ import { SettingsLayout } from '@shared/settingsLayout';
import './index.css';
const appLoader = async () => {
const account = await getActiveAccount();
const stronghold = sessionStorage.getItem('stronghold');
const privkey = JSON.parse(stronghold).state.privkey || null;
const onboarding = localStorage.getItem('onboarding');
const step = JSON.parse(onboarding).state.step || null;
try {
const account = await getActiveAccount();
const stronghold = sessionStorage.getItem('stronghold');
const privkey = JSON.parse(stronghold).state.privkey || null;
const onboarding = localStorage.getItem('onboarding');
const step = JSON.parse(onboarding).state.step || null;
if (step) {
return redirect(step);
if (step) {
return redirect(step);
}
if (!account) {
return redirect('/auth/welcome');
} else {
if (account.privkey.length > 35) {
return redirect('/auth/migrate');
}
if (!privkey) {
return redirect('/auth/unlock');
}
}
return null;
} catch (e) {
throw new Error('App failed to load');
}
if (!account) {
return redirect('/auth/welcome');
}
if (account && account.privkey.length > 35) {
return redirect('/auth/migrate');
}
if (account && !privkey) {
return redirect('/auth/unlock');
}
return null;
};
const router = createBrowserRouter([