Skip to content

Commit

Permalink
Incorrect NFT media placeholder when navigating between pages
Browse files Browse the repository at this point in the history
Fixes #1710
  • Loading branch information
tom2drum committed Mar 18, 2024
1 parent 8c1be25 commit 3b1694d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ui/shared/nft/NftMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen
const { isOpen, onOpen, onClose } = useDisclosure();

const content = (() => {
if (isLoading) {
return null;
}

if (!mediaInfo || isLoadingError) {
const styleProps = withFullscreen ? {} : mediaStyleProps;
return <NftFallback { ...styleProps }/>;
Expand Down Expand Up @@ -78,7 +82,7 @@ const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen
})();

const modal = (() => {
if (!mediaInfo || !withFullscreen) {
if (!mediaInfo || !withFullscreen || isLoading) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion ui/token/TokenInventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const TokenInventory = ({ inventoryQuery, tokenQuery, ownerFilter }: Props) => {
>
{ items.map((item, index) => (
<TokenInventoryItem
key={ token.address + '_' + item.id + (inventoryQuery.isPlaceholderData ? '_' + index : '') }
key={ item.id + '_' + index + (inventoryQuery.isPlaceholderData ? '_' + 'placeholder' : '') }
item={ item }
isLoading={ inventoryQuery.isPlaceholderData || tokenQuery.isPlaceholderData }
token={ token }
Expand Down

0 comments on commit 3b1694d

Please sign in to comment.