Skip to content

Commit

Permalink
Merge pull request #1715 from blockscout/tom2drum/issue-1710
Browse files Browse the repository at this point in the history
Incorrect NFT media placeholder when navigating between pages
  • Loading branch information
tom2drum authored Mar 18, 2024
2 parents 8c1be25 + 3b1694d commit 089e667
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 089e667

Please sign in to comment.