Tweak stream filtering logic

This commit is contained in:
G.Ambatte
2026-10-11 20:47:22 +13:00
parent 7b82971699
commit 478cc6b444
+4 -1
View File
@@ -54,7 +54,10 @@ const unsubscribe = function(id){
Stream.on('sendUpdate', (event, data)=>{
if(DEBUG.showEvents) console.log('Event:', event, '\nData:', data);
subscribers
.filter((sub)=>{return data.shareId == sub.shareId; })
.filter((sub)=>{
if(data?.id) return data.id == sub.id;
return data.shareId == sub.shareId;
})
.forEach((sub)=>{
if(event == 'brewUpdated'){
// Reset the unsubscription timer