Skip to content

Commit

Permalink
Merge pull request #7429 from iotaledger/fix/nft-media
Browse files Browse the repository at this point in the history
fix: nft aspect ratio & crash when navigating to nft details from activity
  • Loading branch information
msarcev authored Sep 14, 2023
2 parents e4e62c1 + bf7aea8 commit 9b59809
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/shared/components/MediaDisplay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<div class="h-full w-full object-cover">
{#if htmlTag === ParentMimeType.Image}
<img {src} {alt} loading="lazy" class="w-full h-full" />
<img {src} {alt} loading="lazy" class="w-full h-full object-cover" />
{:else if htmlTag === ParentMimeType.Video}
<video
loop={loop ? true : undefined}
Expand All @@ -42,7 +42,7 @@
on:mouseenter={startPlaying}
on:mouseleave={stopPlaying}
preload="metadata"
class="w-full h-full"
class="w-full h-full object-cover"
>
<source {src} type={expectedType} />
</video>
Expand Down
3 changes: 3 additions & 0 deletions packages/shared/components/NftActivityDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
closePopup()
$selectedNftId = activity.nftId
$dashboardRouter.goTo(DashboardRoute.Collectibles)
// ugly hack to make sure router routes correctly
await tick()
// ugly hack to avoid a crash when navigating very fast between gallery and details
await tick()
$collectiblesRouter.goTo(CollectiblesRoute.Details)
}
Expand Down

0 comments on commit 9b59809

Please sign in to comment.