Skip to content

Commit

Permalink
Hide nft widget if no nfts (#2051)
Browse files Browse the repository at this point in the history
  • Loading branch information
devkudasov authored Aug 23, 2024
1 parent 5fd08d4 commit fec3ca1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/widgets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,5 @@ export const WidgetRoot = memo(({lastUpdate}: {lastUpdate: number}) => {
});
};

//@ts-ignore
return renderWidgetsList(data);
});
3 changes: 2 additions & 1 deletion src/widgets/nft-widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {TotalValueTabNames} from '@app/components/total-value-info';
import {ShadowCard} from '@app/components/ui/shadow-card';
import {useTypedNavigation} from '@app/hooks';
import {useShowNft} from '@app/hooks/nft';
import {Nft} from '@app/models/nft';
import {HomeStackRoutes} from '@app/route-types';
import {INftWidget, NftWidgetSize} from '@app/types';

Expand All @@ -23,7 +24,7 @@ export const NftWidgetWrapper = observer(({size}: INftWidget) => {

const showNft = useShowNft();

if (!showNft) {
if (!showNft || !Nft.getAll().length) {
return null;
}

Expand Down

0 comments on commit fec3ca1

Please sign in to comment.