Push updates to open receiver selectors

This commit is contained in:
hensm
2020-08-09 17:04:08 +01:00
parent 2bd9c4071f
commit f002acad8c
7 changed files with 50 additions and 19 deletions

View File

@@ -80,11 +80,9 @@ export default new class StatusManager
const { data: receiver } = message;
this.receivers.set(receiver.id, receiver);
const serviceUpEvent = new CustomEvent("serviceUp", {
this.dispatchEvent(new CustomEvent("serviceUp", {
detail: receiver
});
this.dispatchEvent(serviceUpEvent);
}));
break;
}
@@ -96,11 +94,9 @@ export default new class StatusManager
this.receivers.delete(id);
}
const serviceDownEvent = new CustomEvent("serviceDown", {
this.dispatchEvent(new CustomEvent("serviceDown", {
detail: { id }
});
this.dispatchEvent(serviceDownEvent);
}));
break;
}
@@ -121,6 +117,10 @@ export default new class StatusManager
, ...status
}
});
this.dispatchEvent(new CustomEvent("statusUpdate", {
detail: { id, status }
}));
}
}
}