Fix loading watch page if VITE_DEFAULT_DOWNLOAD_ENABLED not defined

This commit is contained in:
WardPearce
2024-09-10 17:11:55 +12:00
parent d5c7d15878
commit 8512e374fb
@@ -52,7 +52,11 @@ export async function load({ params, url }) {
}
let downloadQualitiesDash;
if (import.meta.env.VITE_DEFAULT_DOWNLOAD_ENABLED.toString() === 'true' && typeof video.hlsUrl === 'undefined' && get(playerDashStore)) {
if (
typeof import.meta.env.VITE_DEFAULT_DOWNLOAD_ENABLED !== 'undefined' &&
import.meta.env.VITE_DEFAULT_DOWNLOAD_ENABLED.toString() === 'true' &&
typeof video.hlsUrl === 'undefined' && get(playerDashStore)
) {
downloadQualitiesDash = listCombinedQualities(video.dashUrl);
}