Ledmap not found no toast
This commit is contained in:
@@ -9,7 +9,7 @@ function toggleCEEditor(name, segID) {
|
|||||||
d.getElementById('ceEditor').style.transform = (isCEEditor) ? "translateY(0px)":"translateY(100%)";
|
d.getElementById('ceEditor').style.transform = (isCEEditor) ? "translateY(0px)":"translateY(100%)";
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchAndExecute(url, name, callback)
|
function fetchAndExecute(url, name, callback, toast=true)
|
||||||
{
|
{
|
||||||
fetch
|
fetch
|
||||||
(url+name, {
|
(url+name, {
|
||||||
@@ -17,7 +17,7 @@ function fetchAndExecute(url, name, callback)
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
showToast("File " + name + " not found", true);
|
if (toast) showToast("File " + name + " not found", true);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return res.text();
|
return res.text();
|
||||||
@@ -26,7 +26,7 @@ function fetchAndExecute(url, name, callback)
|
|||||||
callback(text);
|
callback(text);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
showToast("Error getting " + name, true);
|
if (toast) showToast("Error getting " + name, true);
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
@@ -1355,7 +1355,7 @@ function drawSegments() {
|
|||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
post();
|
post();
|
||||||
});
|
}, false); //false: no toast
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
post();
|
post();
|
||||||
@@ -2888,7 +2888,7 @@ function genPresets()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//WLEDMM: utility function to load contents of file from FS (used in draw)
|
//WLEDMM: utility function to load contents of file from FS (used in draw)
|
||||||
function fetchAndExecute(url, name, callback)
|
function fetchAndExecute(url, name, callback, toast=true)
|
||||||
{
|
{
|
||||||
fetch
|
fetch
|
||||||
(url+name, {
|
(url+name, {
|
||||||
@@ -2896,7 +2896,7 @@ function fetchAndExecute(url, name, callback)
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
showToast("File " + name + " not found", true);
|
if (toast) showToast("File " + name + " not found", true);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
console.log("res", res);
|
console.log("res", res);
|
||||||
@@ -2907,7 +2907,7 @@ function fetchAndExecute(url, name, callback)
|
|||||||
callback(text);
|
callback(text);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
// showToast("Error getting " + name, true);
|
if (toast) showToast("Error getting " + name, true);
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|||||||
1485
wled00/html_ui.h
1485
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user