Skip to content

Commit

Permalink
fix(wasm): Fix invalid splash screen path resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Jun 14, 2021
1 parent 65bdf55 commit 3f25381
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Uno.UI/WasmScripts/Uno.UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
10 changes: 9 additions & 1 deletion src/Uno.UI/ts/WindowManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3f25381

Please sign in to comment.