Question: my interface code which mostly works however there is a slight bug, whenever new / updated data is received by my socket code, any expanded

my interface code which mostly works however there is a slight bug, whenever new/updated data is received by my socket code, any expanded table records -displaying the subtable content- automatically close, which is not what i want, my expanded tables should remain expanded unless closed by the user, not when the websocket updates data, please fix this bug -- here is the template code , socket code in script: sockets: {
imwb_updated_diagnostic: function(data){
data.items.forEach((item)=>{
console.log('diagnostic update received: ',data)
const indexOfEl = this.diagnostics.items.findIndex(
x => x.device_serial === item.device_serial && x.sub_type === item.sub_type
);
if (indexOfEl >=0){
for (const key in item){
if (key !== 'device_serial' && key !== 'sub_type'){
this.diagnostics.items[indexOfEl][key]= item[key];
}
}
} else {
this.diagnostics.items.push(item);
}
});
}
},

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!