Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhunter committed Sep 19, 2023
1 parent 24367bd commit 9f51ec2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion patch-top-subscribe-unsubscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module.exports = function (dc) {
return dc.channel(channel).subscribe(cb);
};
dc.unsubscribe = (channel, cb) => {
return dc.channel(channel).unsubscribe(cb);
if (dc.channel(channel).hasSubscribers) {
return dc.channel(channel).unsubscribe(cb);
}
};
};

0 comments on commit 9f51ec2

Please sign in to comment.