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

@@ -11,13 +11,14 @@ import * as row from "./rows";
import * as settings_data from "./settings_data";
import * as stream_data from "./stream_data";
import * as stream_settings_ui from "./stream_settings_ui";
import * as sub_store from "./sub_store";
extend([lchPlugin, mixPlugin]);
export function update_stream_recipient_color($stream_header) {
if ($stream_header.length) {
const stream_id = Number.parseInt($($stream_header).attr("data-stream-id"), 10);
const stream_name = stream_data.maybe_get_stream_name(stream_id);
const stream_name = sub_store.maybe_get_stream_name(stream_id);
if (!stream_name) {
return;
}