Few cleanups to code
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
import toast from "react-hot-toast";
|
||||
import { useSnapshot } from "valtio";
|
||||
import { ArrowSquareOut, Copy, Wallet, X } from "phosphor-react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import Dinero from "dinero.js";
|
||||
|
||||
import Button from "./Button";
|
||||
import { addFaucetAccount, deployHook, importAccount } from "../state/actions";
|
||||
import state from "../state";
|
||||
import Box from "./Box";
|
||||
import Container from "./Container";
|
||||
import Heading from "./Heading";
|
||||
import { ArrowSquareOut, Copy, Wallet, X } from "phosphor-react";
|
||||
import Stack from "./Stack";
|
||||
import Text from "./Text";
|
||||
import Flex from "./Flex";
|
||||
import { useSnapshot } from "valtio";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import Dinero from "dinero.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
|
||||
@@ -57,3 +57,13 @@ export const addFaucetAccount = async (showToast: boolean = false) => {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// fetch initial faucets
|
||||
(async function fetchFaucets() {
|
||||
if (state.accounts.length < 2) {
|
||||
await addFaucetAccount();
|
||||
setTimeout(() => {
|
||||
addFaucetAccount();
|
||||
}, 10000);
|
||||
}
|
||||
})();
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user