Skip to content

Commit b53142f

Browse files
committed
fix lint fmt
1 parent 418eb27 commit b53142f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm fmt && pnpm lint

src/App.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
type TransactionReceipt,
1111
} from "viem";
1212
import { getAddresses, requestAddresses, waitForTransactionReceipt } from "viem/actions";
13-
import { applyChainId, api, isOk, renderJSON } from "./utils/helpers.ts";
13+
import { api, applyChainId, isOk, renderJSON } from "./utils/helpers.ts";
1414
import type {
1515
ApiErr,
1616
ApiOk,
@@ -57,7 +57,7 @@ export function App() {
5757
});
5858
}, [selected, chain]);
5959

60-
const ensureServerConnected = async () => {
60+
const ensureServerConnected = useCallback(async () => {
6161
try {
6262
const resp = await api<
6363
ApiOk<{ connected: boolean; account?: string; chainId?: number }> | ApiErr
@@ -83,9 +83,9 @@ export function App() {
8383
}
8484
}
8585
} catch {}
86-
};
86+
}, [account, chainId]);
8787

88-
const pollTick = async () => {
88+
const pollTick = useCallback(async () => {
8989
await ensureServerConnected();
9090

9191
try {
@@ -109,7 +109,7 @@ export function App() {
109109
}
110110
}
111111
} catch {}
112-
};
112+
}, [ensureServerConnected, pending]);
113113

114114
const connect = async () => {
115115
if (!walletClient || !selected) return;
@@ -253,7 +253,7 @@ export function App() {
253253

254254
// Polling loop to check for new pending transactions.
255255
useEffect(() => {
256-
pollTick();
256+
void pollTick();
257257

258258
if (!pollRef.current) {
259259
pollRef.current = window.setInterval(pollTick, 1000);
@@ -266,7 +266,7 @@ export function App() {
266266

267267
pollRef.current = null;
268268
};
269-
}, [account, chainId, selected]);
269+
}, [pollTick]);
270270

271271
return (
272272
<div className="wrapper">

src/utils/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { hexToBigInt, type Chain } from "viem";
1+
import { type Chain, hexToBigInt } from "viem";
22
import * as chains from "viem/chains";
33

44
export const ALL_CHAINS: readonly Chain[] = Object.freeze(Object.values(chains) as Chain[]);

0 commit comments

Comments
 (0)