Skip to content

Commit

Permalink
[demo] fix: wrapper returning children on wallet disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Envoy-VC committed Dec 28, 2023
1 parent c1dba46 commit 06f2ead
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/demo/src/components/common/wrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import { useActiveAddress } from 'arweave-wallet-kit';
import { useAtomicToolkit } from '~/stores';
import { Button } from 'antd';
import { useAddress } from '@thirdweb-dev/react';

interface Props {
children: React.ReactNode;
}

const Wrapper = ({ children }: Props) => {
const { atomicToolkit, setAtomicToolkit } = useAtomicToolkit();
const { atomicToolkit } = useAtomicToolkit();
const activeAddress = useActiveAddress();
if (atomicToolkit) {
const ethAddress = useAddress();
if (atomicToolkit && (activeAddress || ethAddress)) {
return <>{children}</>;
} else {
return (
Expand Down

0 comments on commit 06f2ead

Please sign in to comment.