fix Custom Effect button missing in action

This commit is contained in:
Ewoud
2022-12-21 13:39:42 +01:00
parent fb5c057f94
commit 05971a2ffe
2 changed files with 8 additions and 7 deletions

View File

@@ -133,13 +133,13 @@ class CustomEffectsUserMod : public Usermod {
*/
void addToJsonState(JsonObject& root)
{
// //root["user0"] = userVar0;
// if (!initDone) return; // prevent crash on boot applyPreset()
// JsonObject usermod = root[FPSTR(_name)];
// if (usermod.isNull()) {
// usermod = root.createNestedObject(FPSTR(_name));
// }
// usermod["on"] = enabled;
//root["user0"] = userVar0;
if (!initDone) return; // prevent crash on boot applyPreset()
JsonObject usermod = root[FPSTR(_name)];
if (usermod.isNull()) {
usermod = root.createNestedObject(FPSTR(_name));
}
usermod["on"] = enabled;
}