What happened?
The drop-down to select preset shows empty on devices like phones vs workstation browsers. In settings_time.htm the line json = JSON.parse(localStorage.getItem("wledP")); is null when running off my phone's browser.
To Reproduce Bug
Try it off other devices
Expected Behavior
Presets should be getting loaded for drop-downs across range of devices
Install Method
Self-Compiled
What version of WLED?
WLED 17.0.0-devV5 (2607201)
Which microcontroller/board are you seeing the problem on?
ESP32-C3
Relevant log/trace output
Anything else?
I believe I found a fix- on settings_time.htm I updated populatePresets(fromls) to...
function populatePresets(fromls) { let json = null;
if (fromls) {
try {
json = JSON.parse(localStorage.getItem("wledP"));
} catch (e) {
console.log("Unable to parse cached presets:", e);
}
}
if (json) {
onPresetsLoaded(json);
return;
}
fetch(getURL("/presets.json"))
.then(response => {
if (!response.ok) {
throw new Error("HTTP " + response.status);
} return response.json();
})
.then(json => {
try {
localStorage.setItem("wledP", JSON.stringify(json));
} catch (e) {
console.log("Unable to cache presets:", e);
}
onPresetsLoaded(json);
})
.catch(error => {
console.log("Unable to load presets:", error);
showToast("Unable to load presets", true);
}); }
Code of Conduct
What happened?
The drop-down to select preset shows empty on devices like phones vs workstation browsers. In settings_time.htm the line
json = JSON.parse(localStorage.getItem("wledP"));is null when running off my phone's browser.To Reproduce Bug
Try it off other devices
Expected Behavior
Presets should be getting loaded for drop-downs across range of devices
Install Method
Self-Compiled
What version of WLED?
WLED 17.0.0-devV5 (2607201)
Which microcontroller/board are you seeing the problem on?
ESP32-C3
Relevant log/trace output
Anything else?
I believe I found a fix- on settings_time.htm I updated populatePresets(fromls) to...
Code of Conduct