Skip to content

Commit 054804b

Browse files
authored
Sergei / fix useLocalStorage initial value type (#13171)
* feat: add empty string to fix type * feat: add check for useSyncLocalStorageClientAccounts hook
1 parent bfb8f7c commit 054804b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/wallets/src/components/WalletTourGuide/WalletMobileTourGuide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const WalletMobileTourGuide = ({
2626
isOptionsAndMultipliersLoaded = true,
2727
isWalletSettled = true,
2828
}: TProps) => {
29-
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key));
29+
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key) ?? '');
3030
const { isMobile } = useDevice();
3131
const { activeTabIndex, setActiveTabIndex } = useTabs();
3232
const [onboardingStep, setOnboardingStep] = useState(0);

packages/wallets/src/components/WalletTourGuide/WalletTourGuide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import './WalletTourGuide.scss';
1616

1717
const WalletTourGuide = () => {
18-
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key));
18+
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key) ?? '');
1919
const [addMoreWalletsTransformValue, setAddMoreWalletsTransformValue] = useState('');
2020
const { isMobile } = useDevice();
2121

packages/wallets/src/hooks/useSyncLocalStorageClientAccounts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const useSyncLocalStorageClientAccounts = () => {
1212
const { data: settingsData } = useSettings();
1313
const [, setLocalStorageClientAccounts] = useLocalStorage(
1414
'client.accounts',
15-
useReadLocalStorage('client.accounts')
15+
useReadLocalStorage('client.accounts') ?? {}
1616
);
1717

1818
const addWalletAccountToLocalStorage = useCallback(

0 commit comments

Comments
 (0)