mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Refresh balance on page load
This commit is contained in:
+7
-2
@@ -1,7 +1,7 @@
|
||||
<script lang="typescript">
|
||||
import { Router, Route } from "svelte-routing";
|
||||
import { getConfig } from '@app/config';
|
||||
import { session } from '@app/session';
|
||||
import { state, session } from '@app/session';
|
||||
|
||||
import Home from '@app/base/home/Index.svelte';
|
||||
import Vesting from '@app/base/vesting/Index.svelte';
|
||||
@@ -13,6 +13,11 @@
|
||||
import Loading from '@app/Loading.svelte';
|
||||
import Modal from '@app/Modal.svelte';
|
||||
|
||||
const loadConfig = getConfig().then(cfg => {
|
||||
state.refreshBalance(cfg);
|
||||
return cfg;
|
||||
});
|
||||
|
||||
function handleKeydown(event: KeyboardEvent) {
|
||||
if (event.key === 'Enter') {
|
||||
let elems = document.querySelectorAll<HTMLElement>('button.primary');
|
||||
@@ -39,7 +44,7 @@
|
||||
|
||||
<svelte:window on:keydown={handleKeydown} />
|
||||
<div class="app">
|
||||
{#await getConfig()}
|
||||
{#await loadConfig}
|
||||
<!-- Loading wallet -->
|
||||
<div class="wrapper">
|
||||
<Loading center />
|
||||
|
||||
Reference in New Issue
Block a user