Dmx.app.set not updating conditions

OK - this is a very stupid fix but it works. I noticed the page updates only when an element is removed from the array. When you add to the array nothing happens (other than the initial item).

So I tried the following - adding 'a' and removing it every time you add the index value.

function bulkArray(id,arr) {
let currentArray = dmx.app.get(arr);
if (currentArray == undefined) currentArray = ;
if (currentArray.includes(id)) {
currentArray = currentArray.filter(item => item !== id);
} else {
currentArray.push(id);
currentArray.push('a');
currentArray = currentArray.filter(item => item !== 'a');
}
dmx.app.set(arr, currentArray);
console.log(currentArray);
console.log(dmx.app.get(arr));
}

I think perhaps a bug as I can't see anything else to explain the behaviour

1 Like