Bug fixing with subscribing to categories

This commit is contained in:
hiimgoodpack 2021-01-27 23:08:45 -05:00
parent bf46bb553c
commit b48b971916
Signed by: hiimgoodpack
GPG key ID: 4E0E62733C14AE69

View file

@ -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);