Few cleanups to code

This commit is contained in:
Valtteri Karesto
2021-12-13 23:02:03 +02:00
parent 380e196db2
commit 35bc89cf99
3 changed files with 16 additions and 17 deletions

View File

@@ -56,4 +56,14 @@ export const addFaucetAccount = async (showToast: boolean = false) => {
isLoading: false,
});
}
};
};
// fetch initial faucets
(async function fetchFaucets() {
if (state.accounts.length < 2) {
await addFaucetAccount();
setTimeout(() => {
addFaucetAccount();
}, 10000);
}
})();

View File

@@ -2,7 +2,6 @@ import { proxy, ref, subscribe } from "valtio";
import { devtools } from 'valtio/utils'
import type monaco from "monaco-editor";
import { XrplClient } from "xrpl-client";
import { addFaucetAccount } from "./actions/addFaucetAccount";
export interface IFile {
name: string;
@@ -116,17 +115,6 @@ client.on("offline", () => {
state.clientStatus = "offline";
});
// fetch initial faucets
(async function fetchFaucets() {
if (state.accounts.length < 2) {
await addFaucetAccount();
setTimeout(() => {
addFaucetAccount();
}, 10000);
}
})();
if (process.env.NODE_ENV !== "production") {
devtools(state, "Files State");
}