From 2bd460effbd6b2b6d87b972ffd7d1673963fda5d Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Mon, 6 Nov 2023 14:48:38 -0800 Subject: [PATCH] fix(web): preview and test releases usage --- web/helpers/urls.ts | 5 +++-- web/store/updateOs.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/helpers/urls.ts b/web/helpers/urls.ts index 0dd11f40d..cfb4695fb 100644 --- a/web/helpers/urls.ts +++ b/web/helpers/urls.ts @@ -21,8 +21,9 @@ const WEBGUI_TOOLS_UPDATE = new URL('/Tools/Update', WEBGUI); const OS_RELEASES = new URL(import.meta.env.VITE_OS_RELEASES ?? 'https://stable.dl.unraid.net/releases-combined.json'); const OS_RELEASES_NEXT = new URL(import.meta.env.VITE_OS_RELEASES_NEXT ?? 'https://next.dl.unraid.net/releases-combined.json'); -const OS_RELEASES_PREVIEW = new URL(import.meta.env.VITE_OS_RELEASES_PREVIEW ?? ''); // @note we don't want these in the webgui -const OS_RELEASES_TEST = new URL(import.meta.env.VITE_OS_RELEASES_PREVIEW ?? ''); // @note we don't want these in the webgui +// @note we don't want PREVIEW / TEST used in the webgui, but they're here as a necessary evil for updateOs imports +const OS_RELEASES_PREVIEW = ''; +const OS_RELEASES_TEST = ''; const DOCS_REGISTRATION_LICENSING = new URL('/unraid-os/faq/licensing-faq', DOCS); const DOCS_REGISTRATION_REPLACE_KEY = new URL('/unraid-os/manual/changing-the-flash-device', DOCS); diff --git a/web/store/updateOs.ts b/web/store/updateOs.ts index 1e5404217..39ff25701 100644 --- a/web/store/updateOs.ts +++ b/web/store/updateOs.ts @@ -241,8 +241,9 @@ export const useUpdateOsStoreGeneric = (payload?: UpdateOsStorePayload) => let releasesUrl = OS_RELEASES; if (useNextBranch) { releasesUrl = OS_RELEASES_NEXT; } - if (usePreviewBranch) { releasesUrl = OS_RELEASES_PREVIEW; } - if (useTestBranch) { releasesUrl = OS_RELEASES_TEST; } + // @note we don't want PREVIEW / TEST used in the webgui hence additional checks to ensure the URLs exist + if (usePreviewBranch && OS_RELEASES_PREVIEW) { releasesUrl = OS_RELEASES_PREVIEW; } + if (useTestBranch && OS_RELEASES_TEST) { releasesUrl = OS_RELEASES_TEST; } return releasesUrl; });