add: broadcast socket id for user sockets
This commit is contained in:
parent
ecde5d3d46
commit
1724f798ca
6 changed files with 48 additions and 16 deletions
|
@ -240,18 +240,13 @@
|
|||
|
||||
streams.subscribe("notifs");
|
||||
streams.event("notifs", "message", (data) => {
|
||||
if (data === "Ping") {
|
||||
return;
|
||||
}
|
||||
|
||||
const json = JSON.parse(data);
|
||||
if (!json.method.Packet) {
|
||||
if (!data.method.Packet) {
|
||||
console.warn("notifications stream cannot read this message");
|
||||
return;
|
||||
}
|
||||
|
||||
const inner_data = JSON.parse(json.data);
|
||||
if (json.method.Packet.Crud === "Create") {
|
||||
const inner_data = JSON.parse(data.data);
|
||||
if (data.method.Packet.Crud === "Create") {
|
||||
const current = Number.parseInt(element.innerText || "0");
|
||||
|
||||
if (current <= 0) {
|
||||
|
@ -293,7 +288,7 @@
|
|||
|
||||
console.info("notification created");
|
||||
}
|
||||
} else if (json.method.Packet.Crud === "Delete") {
|
||||
} else if (data.method.Packet.Crud === "Delete") {
|
||||
const current = Number.parseInt(element.innerText || "0");
|
||||
|
||||
if (current - 1 <= 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue