refactor: Call peer_data.get_subscriber_count().

We are trying to move away from having the
subscriber count on the sub.

This commit handles the easy one-liners
in the JS code.
This commit is contained in:
Steve Howell
2021-01-21 14:55:49 +00:00
committed by Tim Abbott
parent 5babe54310
commit dc9b4de05f
4 changed files with 21 additions and 16 deletions

View File

@@ -3,7 +3,8 @@
const peer_data = require("./peer_data");
function display_pill(sub) {
return "#" + sub.name + ": " + sub.subscriber_count + " users";
const sub_count = peer_data.get_subscriber_count(sub.stream_id);
return "#" + sub.name + ": " + sub_count + " users";
}
exports.create_item_from_stream_name = function (stream_name, current_items) {