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.

unread: Lookup subscription status by ID.

Tim Abbott043d83b434b6
diff --git a/frontend_tests/node_tests/unread.js b/frontend_tests/node_tests/unread.js
index 9afdf5b72de..d2fe67465e1 100644
--- a/frontend_tests/node_tests/unread.js
+++ b/frontend_tests/node_tests/unread.js
@@ -318,7 +318,7 @@ test("num_unread_for_topic", ({override}) => {
});
test("home_messages", ({override}) => {
- override(stream_data, "is_subscribed", () => true);
+ override(stream_data, "id_is_subscribed", () => true);
override(stream_data, "is_muted", () => false);
const stream_id = 401;
@@ -356,7 +356,7 @@ test("home_messages", ({override}) => {
test_notifiable_count(counts.home_unread_messages, 0);
// Now unsubscribe all our streams.
- override(stream_data, "is_subscribed", () => false);
+ override(stream_data, "id_is_subscribed", () => false);
counts = unread.get_counts();
assert.equal(counts.home_unread_messages, 0);
test_notifiable_count(counts.home_unread_messages, 0);
diff --git a/static/js/unread.js b/static/js/unread.js
index d6a68b4a4a6..a9328fcd55e 100644
--- a/static/js/unread.js
+++ b/static/js/unread.js
@@ -244,7 +244,7 @@ class UnreadTopicCounter {
// completely throw away the data. But we do ignore it here,
// so that callers have a view of the **current** world.
const sub = sub_store.get(stream_id);
- if (!sub || !stream_data.is_subscribed(sub.name)) {
+ if (!sub || !stream_data.id_is_subscribed(stream_id)) {
continue;
}