Skip to content

Commit 020c8b7

Browse files
committed
Update DownloadPage to conditionally display readMe link for VisionFive 2 images
- Made the readMe link optional in the TypeScript interface for VisionFive 2 images. - Updated the DownloadPage component to only include the readMe link if it exists, improving the handling of undefined links.
1 parent 324e58b commit 020c8b7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

app/[locale]/download/page.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,14 @@ const DownloadPage = () => {
194194
name: `${t("cards.defaultImages.checksum")}`,
195195
link: version.links.visionfive2Images.checksum,
196196
},
197-
{
198-
name: `${t("cards.visionfive2Images.readMe")}`,
199-
link: version.links.visionfive2Images.readMe,
200-
},
197+
...(version.links.visionfive2Images.readMe
198+
? [
199+
{
200+
name: `${t("cards.visionfive2Images.readMe")}`,
201+
link: version.links.visionfive2Images.readMe,
202+
},
203+
]
204+
: []),
201205
]
202206
: [],
203207
});

types/downloads.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface Links {
7272
};
7373
visionfive2Images?: {
7474
checksum: string;
75-
readMe: string;
75+
readMe?: string;
7676
};
7777
}
7878

0 commit comments

Comments
 (0)