Skip to content

Commit

Permalink
Fix zustand race condition (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
grod220 authored Mar 18, 2024
1 parent 83f12b9 commit 7cdd167
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apps/extension/src/routes/popup/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IndexHeader } from './index-header';
import { useStore } from '../../../state';
import { BlockSync } from './block-sync';
import { localExtStorage } from '@penumbra-zone/storage';
import { addrByIndexSelector } from '../../../state/wallets';
import { addrByIndexSelector, getActiveWallet } from '../../../state/wallets';
import { needsLogin } from '../popup-needs';

export interface PopupLoaderData {
Expand All @@ -17,13 +17,14 @@ export const popupIndexLoader = async (): Promise<Response | PopupLoaderData> =>
(await needsLogin()) ?? { fullSyncHeight: await localExtStorage.get('fullSyncHeight') };

export const PopupIndex = () => {
const activeWallet = useStore(getActiveWallet);
const getAddrByIndex = useStore(addrByIndexSelector);

return (
<div className='flex h-full grow flex-col items-stretch justify-start bg-logo bg-left-bottom px-[30px]'>
<IndexHeader />
<div className='my-32'>
<SelectAccount getAddrByIndex={getAddrByIndex} />
{activeWallet && <SelectAccount getAddrByIndex={getAddrByIndex} />}
</div>
<BlockSync />
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/ui/block-sync-status/large.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const FullySyncedState = ({ latestKnownBlockHeight, fullSyncHeight }: SyncingSta
width='50'
color='var(--teal)'
wrapperClass={cn(
'transition-all duration-300 absolute bottom-0 right-3',
'transition-all duration-300 absolute bottom-0 -left-7',
showLoader ? 'opacity-100' : 'opacity-0',
)}
/>
Expand Down

0 comments on commit 7cdd167

Please sign in to comment.