Commit 452bcc4b authored by tom's avatar tom

OG description bug for NFT instances

Fixes #1578
parent cf6fb442
......@@ -14,7 +14,7 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = {
'/address/[hash]/contract-verification': 'contract verification for %hash%',
'/tokens': 'tokens',
'/token/[hash]': '%symbol% token details',
'/token/[hash]/instance/[id]': 'token instance for %symbol%',
'/token/[hash]/instance/[id]': 'NFT instance',
'/apps': 'apps marketplace',
'/apps/[id]': '- %app_name%',
'/stats': 'statistics',
......
......@@ -5,11 +5,8 @@ import type { Route } from 'nextjs-routes';
import generate from './generate';
export default function update<R extends Route>(route: R, apiData: ApiData<R>) {
const { title, description, opengraph } = generate(route, apiData);
const { title, description } = generate(route, apiData);
window.document.title = title;
window.document.querySelector('meta[name="description"]')?.setAttribute('content', description);
window.document.querySelector('meta[property="og:title"]')?.setAttribute('content', opengraph.title);
opengraph.description &&
window.document.querySelector('meta[property="og:description"]')?.setAttribute('content', opengraph.description);
}
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