Skip to content

Commit

Permalink
add option to pin offline-app page to a specific version (#10195)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl authored Sep 20, 2024
1 parent 86c68d8 commit 6cbce6f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docfiles/offline-app-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,20 @@
window.pxtTickEvent("offlineapp.download", { "target": "@targetid@", "platform": "mac64" });
}
$(function () {
try {
const urlParams = new URLSearchParams(window.location.search);
const versionOverride = urlParams.get("version") || urlParams.get("v");

if (versionOverride && /^v\d+\.\d+\.\d+$/i.test(versionOverride)) {
updateDownloadLinks(versionOverride);
showAgree();
hideLoader();
return;
}
} catch (e) {
console.warn("Could not parse search string", e);
}

$.getJSON("https://makecode.com/api/config/@targetid@/targetconfig")
.then(function (data) {
hideLoader();
Expand Down

0 comments on commit 6cbce6f

Please sign in to comment.