Skip to content

Commit 476ac26

Browse files
authored
Merge pull request wled#2227 from blazoncek/master
Add "on":true to playlist JSON
2 parents 267f515 + 51a4f61 commit 476ac26

File tree

2 files changed

+185
-183
lines changed

2 files changed

+185
-183
lines changed

wled00/data/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,9 +1612,8 @@ function setLor(i) {
16121612

16131613
function setPreset(i) {
16141614
var obj = {"ps": i};
1615-
1615+
if (isPlaylist(i)) obj.on = true; //force on
16161616
showToast("Loading preset " + pName(i) +" (" + i + ")");
1617-
16181617
requestJson(obj);
16191618
}
16201619

@@ -1647,6 +1646,7 @@ function saveP(i,pl) {
16471646
} else {
16481647
if (pl) {
16491648
obj.playlist = plJson[i];
1649+
obj.on = true;
16501650
obj.o = true;
16511651
} else {
16521652
obj.ib = d.getElementById(`p${i}ibtgl`).checked;
@@ -1662,10 +1662,10 @@ function saveP(i,pl) {
16621662
requestJson(obj);
16631663
if (obj.o) {
16641664
pJson[pI] = obj;
1665-
delete pJson[pI].psave;
1666-
delete pJson[pI].o;
1667-
delete pJson[pI].v;
1668-
delete pJson[pI].time;
1665+
delete pJson[pI].psave;
1666+
delete pJson[pI].o;
1667+
delete pJson[pI].v;
1668+
delete pJson[pI].time;
16691669
} else {
16701670
pJson[pI] = {"n":pN, "win":"Please refresh the page to see this newly saved command."};
16711671
if (obj.win) pJson[pI].win = obj.win;
@@ -1686,6 +1686,7 @@ function testPl(i,bt) {
16861686
bt.innerHTML = "<i class='icons btn-icon'>&#xe38f;</i>Stop";
16871687
var obj = {};
16881688
obj.playlist = plJson[i];
1689+
obj.on = true;
16891690
requestJson(obj);
16901691
}
16911692

0 commit comments

Comments
 (0)