refactor: Move maybe_get_stream_name from stream_data to sub_store.

This commit moves `maybe_get_stream_name` function from `stream_data` to `sub_store`
as it didn't had any dependency on `stream_data` and it also helps us to cut off
dependency on `stream_data` for some of the modules including `user_topics`.
This commit is contained in:
Lalit
2023-05-18 19:23:21 +05:30
committed by Tim Abbott
parent 3023091caa
commit 656a31d38d
15 changed files with 49 additions and 46 deletions

View File

@@ -145,9 +145,9 @@ test("basics", () => {
assert.ok(!stream_data.is_muted(social.stream_id));
assert.ok(stream_data.is_muted(denmark.stream_id));
assert.equal(stream_data.maybe_get_stream_name(), undefined);
assert.equal(stream_data.maybe_get_stream_name(social.stream_id), "social");
assert.equal(stream_data.maybe_get_stream_name(42), undefined);
assert.equal(sub_store.maybe_get_stream_name(), undefined);
assert.equal(sub_store.maybe_get_stream_name(social.stream_id), "social");
assert.equal(sub_store.maybe_get_stream_name(42), undefined);
stream_data.set_realm_default_streams([denmark]);
assert.ok(stream_data.is_default_stream_id(denmark.stream_id));