From d4ce828e995d851172e38b6dcd8292e05242cd84 Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 29 May 2023 23:27:44 +0800 Subject: [PATCH] fix downloads page --- frontend/src/utils/index.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/src/utils/index.tsx b/frontend/src/utils/index.tsx index 2172239..fc882bb 100644 --- a/frontend/src/utils/index.tsx +++ b/frontend/src/utils/index.tsx @@ -169,18 +169,20 @@ export function isSystemLightMode() { export function downloadProgramFiles() { manifest.programFiles.forEach(({ url, path }) => { - ReadFileInfo(path).then(info => { - if (info.size == 0 && url) - AddToDownloadList(path, url.replace('@master', '@v' + manifest.version)); - }).catch(() => { - AddToDownloadList(path, url.replace('@master', '@v' + manifest.version)); - }); + if (path) + ReadFileInfo(path).then(info => { + if (info.size == 0 && url) + AddToDownloadList(path, url.replace('@master', '@v' + manifest.version)); + }).catch(() => { + if (url) + AddToDownloadList(path, url.replace('@master', '@v' + manifest.version)); + }); }); } export function forceDownloadProgramFiles() { manifest.programFiles.forEach(({ url, path }) => { - if (url) + if (path && url) AddToDownloadList(path, url.replace('@master', '@v' + manifest.version)); }); }