Segment visualization fix show fx name

This commit is contained in:
Ewoud
2023-02-15 18:13:30 +01:00
parent b6024d2ed0
commit ab8b260608
3 changed files with 806 additions and 795 deletions

View File

@@ -1360,7 +1360,10 @@ function drawSegments() {
ctx.fill();
}
post();
}, false); //false: no toast
}, function(error) { //error handling
console.log(error);
post();
});
}
else
post();
@@ -2893,7 +2896,7 @@ function genPresets()
}
//WLEDMM: utility function to load contents of file from FS (used in draw)
function fetchAndExecute(url, name, callback, toast=true)
function fetchAndExecute(url, name, callback, callError)
{
fetch
(url+name, {
@@ -2901,10 +2904,9 @@ function fetchAndExecute(url, name, callback, toast=true)
})
.then(res => {
if (!res.ok) {
if (toast) showToast("File " + name + " not found", true);
return "";
callError("File " + name + " not found");
return "";
}
console.log("res", res);
return res.text();
})
.then(text => {
@@ -2912,8 +2914,7 @@ function fetchAndExecute(url, name, callback, toast=true)
callback(text);
})
.catch(function (error) {
if (toast) showToast("Error getting " + name, true);
console.log(error);
callError("Error getting " + name);
})
.finally(() => {
console.log("finally");