Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_data: Add subscribed_stream_ids function.

sahil839ed967586148f
diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.js
index 3ef38dff35d..990a467da71 100644
--- a/frontend_tests/node_tests/stream_data.js
+++ b/frontend_tests/node_tests/stream_data.js
@@ -75,6 +75,7 @@ run_test("basics", () => {
assert.deepEqual(stream_data.home_view_stream_names(), ["social"]);
assert.deepEqual(stream_data.subscribed_streams(), ["social", "test"]);
assert.deepEqual(stream_data.get_colors(), ["red", "yellow"]);
+ assert.deepEqual(stream_data.subscribed_stream_ids(), [social.stream_id, test.stream_id]);
assert(stream_data.is_subscribed("social"));
assert(stream_data.is_subscribed("Social"));
diff --git a/static/js/stream_data.js b/static/js/stream_data.js
index 9060963d6d9..00c6e4599b4 100644
--- a/static/js/stream_data.js
+++ b/static/js/stream_data.js
@@ -366,6 +366,10 @@ exports.subscribed_streams = function () {
return exports.subscribed_subs().map((sub) => sub.name);
};
+exports.subscribed_stream_ids = function () {
+ return exports.subscribed_subs().map((sub) => sub.stream_id);
+};
+
exports.get_invite_stream_data = function () {
function get_data(sub) {
return {