mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-19 05:08:15 +00:00
Tweak stream filtering logic
This commit is contained in:
@@ -54,7 +54,10 @@ const unsubscribe = function(id){
|
|||||||
Stream.on('sendUpdate', (event, data)=>{
|
Stream.on('sendUpdate', (event, data)=>{
|
||||||
if(DEBUG.showEvents) console.log('Event:', event, '\nData:', data);
|
if(DEBUG.showEvents) console.log('Event:', event, '\nData:', data);
|
||||||
subscribers
|
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)=>{
|
.forEach((sub)=>{
|
||||||
if(event == 'brewUpdated'){
|
if(event == 'brewUpdated'){
|
||||||
// Reset the unsubscription timer
|
// Reset the unsubscription timer
|
||||||
|
|||||||
Reference in New Issue
Block a user