zhereh-frontend

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 4d4c64b4da8549edb778fbf9f72bea3e3c9ea93c
parent 9c5948cb04204ad6f41b560be5dd7a18033941eb
Author: William Muli <willi.wambu@gmail.com>
Date:   Fri, 30 Jun 2023 13:09:00 +0300

Check chain Id before using localstorage value

Diffstat:
Msrc/components/Nav.svelte | 2+-
Msrc/store.ts | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/components/Nav.svelte b/src/components/Nav.svelte @@ -7,7 +7,7 @@ import { reduceAddress } from "../utils/reduce-address" import { formatEther, formatUnits, getContract, numberToHex, type RequestAddressesReturnType } from "viem" import { erc20TokenAbi } from "../shared/erc20-token-abi" - + let networkModalOpen: boolean = false let tokenModalOpen: boolean = false let balance: bigint diff --git a/src/store.ts b/src/store.ts @@ -41,7 +41,7 @@ const createChain = () => { localValue = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEYS.CHAIN_CONFIG) || '{}') } - const { subscribe, update } = writable<Chain>(localValue || initialChain) + const { subscribe, update } = writable<Chain>(localValue?.id ? localValue : initialChain) return { subscribe,