From 2d0030e3d46436253e9bf77024cf54aaf0e2841e Mon Sep 17 00:00:00 2001 From: Azgaar Date: Tue, 1 Oct 2024 21:20:29 +0200 Subject: [PATCH] feat: allow to crean data in case of load error --- index.html | 4 ++-- main.js | 2 +- modules/io/load.js | 3 +++ versioning.js | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index e2be2515..a556d5c7 100644 --- a/index.html +++ b/index.html @@ -8072,7 +8072,7 @@ - + @@ -8118,7 +8118,7 @@ - + diff --git a/main.js b/main.js index 7afe4cf6..48afa810 100644 --- a/main.js +++ b/main.js @@ -691,7 +691,7 @@ async function generate(options) { title: "Generation error", width: "32em", buttons: { - "Cleanup data": cleanupData, + "Clear cache": () => cleanupData(), Regenerate: function () { regenerateMap("generation error"); $(this).dialog("close"); diff --git a/modules/io/load.js b/modules/io/load.js index a3f39913..9d3592f9 100644 --- a/modules/io/load.js +++ b/modules/io/load.js @@ -96,6 +96,7 @@ function showUploadErrorMessage(error, URL, random) { title: "Loading error", width: "32em", buttons: { + "Clear cache": () => cleanupData(), OK: function () { $(this).dialog("close"); } @@ -195,6 +196,7 @@ function showUploadMessage(type, mapData, mapVersion) { $("#alert").dialog({ title, buttons: { + "Clear cache": () => cleanupData(), OK: function () { $(this).dialog("close"); } @@ -735,6 +737,7 @@ async function parseLoadedData(data, mapVersion) { title: "Loading error", maxWidth: "50em", buttons: { + "Clear cache": () => cleanupData(), "Select file": function () { $(this).dialog("close"); mapToLoad.click(); diff --git a/versioning.js b/versioning.js index 3b86e7d1..a4eb0a72 100644 --- a/versioning.js +++ b/versioning.js @@ -12,7 +12,7 @@ * * Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2 */ -const VERSION = "1.105.8"; +const VERSION = "1.105.9"; if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function"); { @@ -58,7 +58,7 @@ if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format o width: "28em", position: {my: "center center-4em", at: "center", of: "svg"}, buttons: { - "Cleanup data": () => cleanupData(), + "Clear cache": () => cleanupData(), "Don't show again": function () { $(this).dialog("close"); localStorage.setItem("version", VERSION);