feat: don't show auto-update dialog

This commit is contained in:
Azgaar 2024-02-17 17:18:06 +01:00
parent 0fdfe706f6
commit d91d1cf592

View file

@ -183,22 +183,22 @@ function showUploadMessage(type, mapData, mapVersion) {
title = "Newer file"; title = "Newer file";
canBeLoaded = false; canBeLoaded = false;
} else if (type === "outdated") { } else if (type === "outdated") {
message = `The map version (${mapVersion}) does not match the Generator version (${version}).<br>That is fine, click OK to the get map <b style="color: #005000">auto-updated</b>.<br>In case of issues please keep using an ${archive} of the Generator`; INFO && console.info(`Loading map. Auto-update from ${mapVersion} to ${version}`);
title = "Outdated file"; parseLoadedData(mapData, mapVersion);
canBeLoaded = true; return;
} }
alertMessage.innerHTML = message; alertMessage.innerHTML = message;
const buttons = { const buttons = {
OK: function () { OK: function () {
$(this).dialog("close"); $(this).dialog("close");
if (canBeLoaded) parseLoadedData(mapData); if (canBeLoaded) parseLoadedData(mapData, mapVersion);
} }
}; };
$("#alert").dialog({title, buttons}); $("#alert").dialog({title, buttons});
} }
async function parseLoadedData(data) { async function parseLoadedData(data, mapVersion) {
try { try {
// exit customization // exit customization
if (window.closeDialogs) closeDialogs(); if (window.closeDialogs) closeDialogs();
@ -638,7 +638,7 @@ async function parseLoadedData(data) {
ERROR && console.error(error); ERROR && console.error(error);
clearMainTip(); clearMainTip();
alertMessage.innerHTML = /* html */ `An error is occured on map loading. Select a different file to load, <br />generate a new random map or cancel the loading alertMessage.innerHTML = /* html */ `An error is occured on map loading. Select a different file to load, <br>generate a new random map or cancel the loading.<br>Map version: ${mapVersion}. Generator version: ${version}.
<p id="errorBox">${parseError(error)}</p>`; <p id="errorBox">${parseError(error)}</p>`;
$("#alert").dialog({ $("#alert").dialog({