Skip to content

Commit

Permalink
Sergei / fix useLocalStorage initial value type (#13171)
Browse files Browse the repository at this point in the history
* feat: add empty string to fix type

* feat: add check for useSyncLocalStorageClientAccounts hook
  • Loading branch information
sergei-deriv authored Jan 26, 2024
1 parent bfb8f7c commit 054804b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const WalletMobileTourGuide = ({
isOptionsAndMultipliersLoaded = true,
isWalletSettled = true,
}: TProps) => {
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key));
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key) ?? '');
const { isMobile } = useDevice();
const { activeTabIndex, setActiveTabIndex } = useTabs();
const [onboardingStep, setOnboardingStep] = useState(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import './WalletTourGuide.scss';

const WalletTourGuide = () => {
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key));
const [walletsOnboarding, setWalletsOnboarding] = useLocalStorage(key, useReadLocalStorage(key) ?? '');
const [addMoreWalletsTransformValue, setAddMoreWalletsTransformValue] = useState('');
const { isMobile } = useDevice();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const useSyncLocalStorageClientAccounts = () => {
const { data: settingsData } = useSettings();
const [, setLocalStorageClientAccounts] = useLocalStorage(
'client.accounts',
useReadLocalStorage('client.accounts')
useReadLocalStorage('client.accounts') ?? {}
);

const addWalletAccountToLocalStorage = useCallback(
Expand Down

0 comments on commit 054804b

Please sign in to comment.