Skip to content

Commit

Permalink
fix: Adjust for invalid splashscreen uri
Browse files Browse the repository at this point in the history
This fixes an issue where the splashscreen image may not appear properly when the uno bootstrapper already rewrites the uri to include the package path.
  • Loading branch information
jeromelaban committed Jul 12, 2021
1 parent 7bab9d1 commit 8faa64e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Uno.UI/ts/WindowManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ namespace Uno.UI {
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);
let fullImagePath = String(UnoAppManifest.splashScreenImage);

// If the splashScreenImage image already points to the app base path, use it, otherwise we build it.
if (UNO_BOOTSTRAP_APP_BASE !== '' && fullImagePath.indexOf(UNO_BOOTSTRAP_APP_BASE) == -1) {
fullImagePath = `${UNO_BOOTSTRAP_WEBAPP_BASE_PATH}${UNO_BOOTSTRAP_APP_BASE}/${UnoAppManifest.splashScreenImage}`;
}

img.src = fullImagePath;

Expand Down

0 comments on commit 8faa64e

Please sign in to comment.