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 = [
|
const data = [
|
||||||
"subscribe",
|
"subscribe",
|
||||||
categoriesID
|
[categoriesID]
|
||||||
];
|
];
|
||||||
|
|
||||||
socket.send(`42/gateway,${JSON.stringify(data)}`);
|
socket.send(`42/gateway,${JSON.stringify(data)}`);
|
||||||
|
@ -293,7 +293,11 @@ module.exports.categories = {
|
||||||
}
|
}
|
||||||
case "clientListUpdate": {
|
case "clientListUpdate": {
|
||||||
const categoryID = data[1].category._id;
|
const categoryID = data[1].category._id;
|
||||||
|
if (!categories[categoryID])
|
||||||
|
categories[categoryID] = {};
|
||||||
|
|
||||||
const callback = categories[categoryID].updateCallback;
|
const callback = categories[categoryID].updateCallback;
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
categories[categoryID].updateCallback = null;
|
categories[categoryID].updateCallback = null;
|
||||||
callback(categoryID);
|
callback(categoryID);
|
||||||
|
|
Loading…
Reference in a new issue