@@ -10,7 +10,7 @@ import {
1010 type TransactionReceipt ,
1111} from "viem" ;
1212import { 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" ;
1414import 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" >
0 commit comments