mirror of
https://github.com/gravesoft/msdl.git
synced 2026-07-25 08:34:28 +00:00
fix retry logic
This commit is contained in:
+10
-12
@@ -40,14 +40,6 @@ function updateVars() {
|
||||
|
||||
function updateContent(content, response) {
|
||||
content.innerHTML = response;
|
||||
let errorMessage = document.getElementById('errorModalMessage');
|
||||
|
||||
if (errorMessage) {
|
||||
processingError.style.display = "block";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function langJsonStrToHTML(jsonStr) {
|
||||
@@ -103,8 +95,7 @@ function onLanguageXhrChange() {
|
||||
|
||||
let langHtml = langJsonStrToHTML(this.responseText);
|
||||
|
||||
if (!updateContent(msContent, langHtml))
|
||||
return;
|
||||
msContent.innerHTML = langHtml
|
||||
|
||||
let submitSku = document.getElementById('submit-sku');
|
||||
submitSku.setAttribute("onClick", "getDownload();");
|
||||
@@ -119,6 +110,13 @@ function onDownloadsXhrChange() {
|
||||
if (!(this.status == 200))
|
||||
return;
|
||||
|
||||
let j = JSON.parse(this.responseText)
|
||||
|
||||
if (j["Error"]) {
|
||||
processingError.style.display = "block";
|
||||
wasSuccessful = false;
|
||||
}
|
||||
|
||||
if (pleaseWait.style.display != "block")
|
||||
return;
|
||||
|
||||
@@ -204,8 +202,8 @@ function useSharedSession() {
|
||||
function retryDownload() {
|
||||
pleaseWait.style.display = "block";
|
||||
processingError.style.display = 'none';
|
||||
|
||||
let url = langsUrl + "&productEditionId=" + window.location.hash.substring(1) + "&sessionId=" + sharedSessionGUID;
|
||||
let productId = window.location.hash.substring(1);
|
||||
let url = `${msApiUrl}getskuinformationbyproductedition${parms}${sharedSessionGUID}&ProductEditionId=${productId}`;
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.onload = getDownload;
|
||||
xhr.open("GET", url);
|
||||
|
||||
Reference in New Issue
Block a user