From 3f25381bb58aa53dc70893ef46211278de95c48f Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Thu, 10 Jun 2021 17:59:49 -0400 Subject: [PATCH] fix(wasm): Fix invalid splash screen path resolution --- src/Uno.UI/WasmScripts/Uno.UI.js | 7 ++++++- src/Uno.UI/ts/WindowManager.ts | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Uno.UI/WasmScripts/Uno.UI.js b/src/Uno.UI/WasmScripts/Uno.UI.js index 2bd6800b1424..4773133777a7 100644 --- a/src/Uno.UI/WasmScripts/Uno.UI.js +++ b/src/Uno.UI/WasmScripts/Uno.UI.js @@ -407,7 +407,12 @@ var Uno; // created later on img.onload = loadingDone; img.onerror = loadingDone; - img.src = String(UnoAppManifest.splashScreenImage); + const UNO_BOOTSTRAP_APP_BASE = config.environmentVariables["UNO_BOOTSTRAP_APP_BASE"] || ""; + const UNO_BOOTSTRAP_WEBAPP_BASE_PATH = config.environmentVariables["UNO_BOOTSTRAP_WEBAPP_BASE_PATH"] || ""; + const fullImagePath = UNO_BOOTSTRAP_APP_BASE !== '' + ? `${UNO_BOOTSTRAP_WEBAPP_BASE_PATH}${UNO_BOOTSTRAP_APP_BASE}/${UnoAppManifest.splashScreenImage}` + : String(UnoAppManifest.splashScreenImage); + img.src = fullImagePath; // If there's no response, skip the loading setTimeout(loadingDone, 2000); }); diff --git a/src/Uno.UI/ts/WindowManager.ts b/src/Uno.UI/ts/WindowManager.ts index 679f47853294..885b6d822bd7 100644 --- a/src/Uno.UI/ts/WindowManager.ts +++ b/src/Uno.UI/ts/WindowManager.ts @@ -107,7 +107,15 @@ namespace Uno.UI { // created later on img.onload = loadingDone; img.onerror = loadingDone; - img.src = String(UnoAppManifest.splashScreenImage); + + const UNO_BOOTSTRAP_APP_BASE = config.environmentVariables["UNO_BOOTSTRAP_APP_BASE"] || ""; + const UNO_BOOTSTRAP_WEBAPP_BASE_PATH = config.environmentVariables["UNO_BOOTSTRAP_WEBAPP_BASE_PATH"] || ""; + + const fullImagePath = UNO_BOOTSTRAP_APP_BASE !== '' + ? `${UNO_BOOTSTRAP_WEBAPP_BASE_PATH}${UNO_BOOTSTRAP_APP_BASE}/${UnoAppManifest.splashScreenImage}` + : String(UnoAppManifest.splashScreenImage); + + img.src = fullImagePath; // If there's no response, skip the loading setTimeout(loadingDone, 2000);