Skip to content

Commit 8125723

Browse files
committed
fix: eslint errors
1 parent ed9be34 commit 8125723

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

templates/escrows/indicators/balance-progress/donut/BalanceProgress.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-nocheck
21
import * as React from "react";
32
import { useGetMultipleEscrowBalancesQuery } from "@/components/tw-blocks/tanstack/useGetMultipleEscrowBalances";
43
import { formatCurrency } from "@/components/tw-blocks/helpers/format.helper";

templates/providers/EscrowProvider.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}, []);

templates/wallet-kit/WalletProvider.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)