File tree Expand file tree Collapse file tree
escrows/indicators/balance-progress/donut Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // @ts -nocheck
21import * as React from "react" ;
32import { useGetMultipleEscrowBalancesQuery } from "@/components/tw-blocks/tanstack/useGetMultipleEscrowBalances" ;
43import { formatCurrency } from "@/components/tw-blocks/helpers/format.helper" ;
Original file line number Diff line number Diff line change @@ -59,16 +59,20 @@ export const EscrowProvider = ({ children }: { children: ReactNode }) => {
5959 const [ userRolesInEscrow , setUserRolesInEscrowState ] = useState < string [ ] > ( [ ] ) ;
6060
6161 /**
62- * Get the selected escrow from the local storage
62+ * Load saved wallet information from localStorage when the component mounts
63+ * This ensures the wallet state persists across browser sessions
6364 */
6465 useEffect ( ( ) => {
6566 try {
6667 const stored = localStorage . getItem ( LOCAL_STORAGE_KEY ) ;
6768 if ( stored ) {
6869 const parsed : Escrow = JSON . parse ( stored ) ;
70+ // This effect initializes state from localStorage once on mount.
71+ // It is a controlled sync from an external store, so we allow setState here.
72+ // eslint-disable-next-line react-hooks/set-state-in-effect
6973 setSelectedEscrowState ( parsed ) ;
7074 }
71- } catch ( _err ) {
75+ } catch {
7276 // ignore malformed localStorage content
7377 }
7478 } , [ ] ) ;
Original file line number Diff line number Diff line change @@ -41,7 +41,11 @@ export const WalletProvider = ({ children }: { children: ReactNode }) => {
4141 const storedAddress = localStorage . getItem ( "walletAddress" ) ;
4242 const storedName = localStorage . getItem ( "walletName" ) ;
4343
44+ // This effect initializes state from localStorage once on mount.
45+ // It is a controlled sync from an external store, so we allow setState here.
46+ // eslint-disable-next-line react-hooks/set-state-in-effect
4447 if ( storedAddress ) setWalletAddress ( storedAddress ) ;
48+ // eslint-disable-next-line react-hooks/set-state-in-effect
4549 if ( storedName ) setWalletName ( storedName ) ;
4650 } , [ ] ) ;
4751
You can’t perform that action at this time.
0 commit comments