mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 10:31:24 +01:00
fix: showUploadMessage function not called correctly for isUpdated case
This commit is contained in:
parent
6000f82ac9
commit
85e868a351
2 changed files with 7 additions and 7 deletions
|
|
@ -119,7 +119,7 @@ function uploadMap(file, callback) {
|
|||
const isOutdated = compareVersions(mapVersion, version).isOlder;
|
||||
|
||||
if (isInvalid) return showUploadMessage("invalid", mapData, mapVersion);
|
||||
if (isUpdated) return parseLoadedData("updated", mapData, mapVersion);
|
||||
if (isUpdated) return showUploadMessage("updated", mapData, mapVersion);
|
||||
if (isAncient) return showUploadMessage("ancient", mapData, mapVersion);
|
||||
if (isNewer) return showUploadMessage("newer", mapData, mapVersion);
|
||||
if (isOutdated) return showUploadMessage("outdated", mapData, mapVersion);
|
||||
|
|
@ -169,8 +169,8 @@ async function parseLoadedResult(result) {
|
|||
const decoded = isDelimited ? resultAsString : decodeURIComponent(atob(resultAsString));
|
||||
|
||||
const mapData = decoded.split("\r\n");
|
||||
const mapVersion = mapData[0].split("|")[0] || mapData[0];
|
||||
return [mapData, mapVersion];
|
||||
const mapVersionString = mapData[0].split("|")[0] || mapData[0] || "";
|
||||
return [mapData, mapVersionString];
|
||||
} catch (error) {
|
||||
// map file can be compressed with gzip
|
||||
const uncompressedData = await uncompress(result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue