Check connection before updating balance

This commit is contained in:
Alexis Sellier
2021-06-16 19:14:05 +02:00
parent 66c920d578
commit 8a1c1940fa
+4 -2
View File
@@ -1,7 +1,7 @@
<script lang="typescript">
import { Router, Route } from "svelte-routing";
import { getConfig } from '@app/config';
import { state, session } from '@app/session';
import { Connection, state, session } from '@app/session';
import Home from '@app/base/home/Index.svelte';
import Vesting from '@app/base/vesting/Index.svelte';
@@ -15,7 +15,9 @@
import Modal from '@app/Modal.svelte';
const loadConfig = getConfig().then(cfg => {
state.refreshBalance(cfg);
if ($state.connection === Connection.Connected) {
state.refreshBalance(cfg);
}
return cfg;
});