fix(web): preview and test releases usage

This commit is contained in:
Zack Spear
2023-11-06 14:48:38 -08:00
parent fdadfe699c
commit 2bd460effb
2 changed files with 6 additions and 4 deletions

View File

@@ -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);

View File

@@ -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;
});