Bug fixing with subscribing to categories
This commit is contained in:
parent
bf46bb553c
commit
b48b971916
1 changed files with 5 additions and 1 deletions
6
index.js
6
index.js
|
@ -237,7 +237,7 @@ module.exports.categories = {
|
|||
}
|
||||
const data = [
|
||||
"subscribe",
|
||||
categoriesID
|
||||
[categoriesID]
|
||||
];
|
||||
|
||||
socket.send(`42/gateway,${JSON.stringify(data)}`);
|
||||
|
@ -293,7 +293,11 @@ module.exports.categories = {
|
|||
}
|
||||
case "clientListUpdate": {
|
||||
const categoryID = data[1].category._id;
|
||||
if (!categories[categoryID])
|
||||
categories[categoryID] = {};
|
||||
|
||||
const callback = categories[categoryID].updateCallback;
|
||||
|
||||
if (callback) {
|
||||
categories[categoryID].updateCallback = null;
|
||||
callback(categoryID);
|
||||
|
|
Loading…
Reference in a new issue