Commit 089e6674 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Merge pull request #1715 from blockscout/tom2drum/issue-1710

Incorrect NFT media placeholder when navigating between pages
parents 8c1be25f 3b1694dc
......@@ -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 }/>;
......@@ -78,7 +82,7 @@ const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen
})();
const modal = (() => {
if (!mediaInfo || !withFullscreen) {
if (!mediaInfo || !withFullscreen || isLoading) {
return null;
}
......
......@@ -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 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment