Skip to content

Commit

Permalink
wallet-ext,explorer: fix wrong display nft image url (MystenLabs#10221)
Browse files Browse the repository at this point in the history
* img_url -> image_url to match the standard
https://docs.sui.io/build/sui-object-display
  • Loading branch information
pchrysochoidis authored Mar 31, 2023
1 parent 4836b76 commit 101ed9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/explorer/src/utils/objectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { findIPFSvalue } from './stringUtils';
import type { SuiObjectResponse } from '@mysten/sui.js';

export function parseImageURL(display?: Record<string, string>) {
const url = display?.img_url;
const url = display?.image_url;
if (url) {
if (findIPFSvalue(url)) return url;
// String representing true http/https URLs are valid:
Expand Down
4 changes: 2 additions & 2 deletions apps/wallet/src/ui/app/hooks/useGetNFTMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export function useGetNFTMeta(objectID: string) {
if (!resp.data) return null;
const { data } = resp.data || {};
if (!is(data, SuiObjectData) || !data.display) return null;
const { name, description, creator, img_url, link, project_url } =
const { name, description, creator, image_url, link, project_url } =
data.display;
return {
name: name || null,
description: description || null,
imageUrl: img_url || null,
imageUrl: image_url || null,
link: link || null,
projectUrl: project_url || null,
creator: creator || null,
Expand Down

0 comments on commit 101ed9e

Please sign in to comment.