fix: click card view link to 404 page when card rendering(#15526)

This commit is contained in:
gordern 2021-07-05 13:55:41 +08:00 committed by GitHub
parent 2cb13e695e
commit b20293d1b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ interface LinkProps {
} }
const AnchorLink: React.FC<LinkProps> = ({ to, children }) => ( const AnchorLink: React.FC<LinkProps> = ({ to, children }) => (
<a href={to}>{children}</a> <a {...(to ? { href: to } : {})}>{children}</a>
); );
interface CardProps { interface CardProps {

View File

@ -134,7 +134,7 @@ export default function ChartCard({
return ( return (
<CardStyles <CardStyles
onClick={() => { onClick={() => {
if (!bulkSelectEnabled) { if (!bulkSelectEnabled && chart.url) {
window.location.href = chart.url; window.location.href = chart.url;
} }
}} }}