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.

message_view_header: Remove unnecessary complexity.

Tim Abbott3f307f5941dd
diff --git a/web/src/message_view_header.ts b/web/src/message_view_header.ts
index fb38ffa5954..b4bb89b9b8c 100644
--- a/web/src/message_view_header.ts
+++ b/web/src/message_view_header.ts
@@ -3,7 +3,6 @@ import assert from "minimalistic-assert";
import render_message_view_header from "../templates/message_view_header.hbs";
-import * as blueslip from "./blueslip";
import type {Filter} from "./filter";
import * as hash_util from "./hash_util";
import {$t} from "./i18n";
@@ -131,17 +130,7 @@ function get_message_view_header_context(filter: Filter | undefined): MessageVie
}
export function colorize_message_view_header(): void {
- const filter = narrow_state.filter();
- let current_sub;
- if (filter?.has_operator("channel")) {
- current_sub = stream_data.get_sub_by_id_string(filter.operands("channel")[0]!);
- if (current_sub === undefined) {
- blueslip.error("Unexpected undefined sub", {
- stream_id: filter.operands("channel")[0],
- filter,
- });
- }
- }
+ const current_sub = narrow_state.stream_sub();
if (!current_sub) {
return;
}