Fetch accounts only on client side

This commit is contained in:
Valtteri Karesto
2021-12-13 23:06:13 +02:00
parent 67d1b72331
commit c3bf31d993

View File

@@ -60,10 +60,12 @@ export const addFaucetAccount = async (showToast: boolean = false) => {
// fetch initial faucets
(async function fetchFaucets() {
if (state.accounts.length < 2) {
await addFaucetAccount();
setTimeout(() => {
addFaucetAccount();
}, 10000);
if (typeof window !== 'undefined') {
if (state.accounts.length < 2) {
await addFaucetAccount();
setTimeout(() => {
addFaucetAccount();
}, 10000);
}
}
})();