Skip to content

Commit

Permalink
Direct as default
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlau12 committed Apr 8, 2024
1 parent 61e0222 commit f3cd57c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ <h1>App Badge test page</h1>

const badgeElement = document.createElement("ms-store-badge");
badgeElement.setAttribute("productId", appId);
badgeElement.setAttribute("productname", "Placeholder");
badgeElement.setAttribute("cid", campaignId);
badgeElement.setAttribute("window-mode", launchMode);
badgeElement.setAttribute("theme", theme);
Expand Down
2 changes: 0 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,13 @@ <h1>App Badge test page</h1>
const theme = document.querySelector("#themeSelector").value;
const animation = document.querySelector("#animationSelector").value;

console.log(language);
// We must have an app ID
if (!appId || appId.length < 12) {
return;
}

const badgeElement = document.createElement("ms-store-badge");
badgeElement.setAttribute("productId", appId);
badgeElement.setAttribute("productname", "Placeholder");
badgeElement.setAttribute("cid", campaignId);
badgeElement.setAttribute("window-mode", launchMode);
badgeElement.setAttribute("theme", theme);
Expand Down
4 changes: 2 additions & 2 deletions src/ms-store-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MSStoreBadge extends HTMLElement {
/**
* Indicates whether popup or full mode should be launched.
*/
windowMode: "direct" | "popup" | "full" = "popup";
windowMode: "direct" | "popup" | "full" = "direct";

/**
* Indicates whether badge should be in dark mode, light mode, or auto mode.
Expand Down Expand Up @@ -63,7 +63,7 @@ class MSStoreBadge extends HTMLElement {

private readonly PSIDownloadUrl: string = "https://get.microsoft.com/installer/download/";
private readonly throttleDownload = throttle(performPSIAcquisition, 1500);
private readonly imgPSIHandler = () => this.throttleDownload(this.productId, this.productName, undefined, this.getPSIUrl());
private readonly imgPSIHandler = () => this.throttleDownload(this.productId, this.productName || "Microsoft Store Direct", undefined, this.getPSIUrl());
private readonly imgPDPHandler = (e: MouseEvent) => this.launchApp(e);

constructor() {
Expand Down

0 comments on commit f3cd57c

Please sign in to comment.