mirror of https://github.com/zulip/zulip.git
stream_data: Add subscribed_stream_ids function.
We add a function subscribed_stream_ids which returns an array of stream ids of all subscribed streams. This is a prep commit for changing the logic for sorting streams to store stream ids instead of names.
This commit is contained in:
parent
08701d0287
commit
ed96758614
|
@ -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"));
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue