1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00

fix: Subscribe only when needed

This commit is contained in:
Maksim Eltyshev 2023-01-05 15:03:06 +01:00
parent b955e933b2
commit 58eda7d555
10 changed files with 28 additions and 23 deletions

View file

@ -11,6 +11,9 @@ module.exports = {
regex: /^[0-9]+$/,
required: true,
},
subscribe: {
type: 'boolean',
},
},
exits: {
@ -73,8 +76,8 @@ module.exports = {
card.isSubscribed = isSubscribedByCardId[card.id] || false;
});
if (this.req.isSocket) {
sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed
if (inputs.subscribe && this.req.isSocket) {
sails.sockets.join(this.req, `board:${board.id}`);
}
return {