Skip to content

Commit

Permalink
fix: justweb3button infinite loading
Browse files Browse the repository at this point in the history
  • Loading branch information
HadiKhai committed Nov 15, 2024
1 parent 3516d8a commit 465453c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions packages/@justweb3/efp-plugin/src/stories/efp.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const JustWeb3Config: JustWeb3ProviderConfig = {
domain: import.meta.env.STORYBOOK_APP_DOMAIN,
signInTtl: 1000 * 60 * 60 * 24,
},
backendUrl: import.meta.env.STORYBOOK_APP_BACKEND_URL,
// backendUrl: import.meta.env.STORYBOOK_APP_BACKEND_URL,
networks: [
{
chainId: 1,
Expand All @@ -40,7 +40,7 @@ const JustWeb3Config: JustWeb3ProviderConfig = {
],
openOnWalletConnect: false,
allowedEns: 'all',
// dev: import.meta.env.STORYBOOK_APP_DEV === 'true',
dev: import.meta.env.STORYBOOK_APP_DEV === 'true',
plugins: [EFPPlugin],
};

Expand Down Expand Up @@ -106,6 +106,9 @@ export const Example = () => {
<JustEnsCard addressOrEns={'dr3a.eth'} />
<JustEnsCard addressOrEns={'josh.box'} />
<JustEnsCard addressOrEns={'justghadi.eth'} />
<JustEnsCard addressOrEns={'justan.id'} />
<JustEnsCard addressOrEns={'jaw.eth'} chainId={11155111} />
<JustEnsCard addressOrEns={'yodl.me'} />
<JustEnsCard
addressOrEns={'0x7Ca2C8acAcf728CeFB6c8cd8E9b2063C8763feB1'}
chainId={1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const JustWeb3Button: FC<JustWeb3Buttonrops> = ({
}
};

if (isEnsAuthLoading || (connectedEns && isRecordsPending)) {
if (isEnsAuthLoading || (connectedEns?.ens && isRecordsPending)) {
return (
<ClickableItem
title={'loading'}
Expand All @@ -108,7 +108,7 @@ export const JustWeb3Button: FC<JustWeb3Buttonrops> = ({
);
}

if (!connectedEns) {
if (!connectedEns?.ens) {
if (isConnected && address) {
return (
<ClickableItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ const MembersSection: React.FC<MembersSectionProps> = ({
key={`display-record-members-${fullSubname}-${subname}`}
className={styles.memberCard}
>
<JustEnsCard addressOrEns={subname} style={{ width: '100%' }} />
<JustEnsCard
addressOrEns={subname}
style={{ width: '100%' }}
chainId={chainId}
/>
</div>
))}

Expand Down

0 comments on commit 465453c

Please sign in to comment.