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.

filter: Standardize type of has_topic's stream_id.

Evy Kassirer02f1a624f77d
diff --git a/web/src/filter.ts b/web/src/filter.ts
index 3c7d62746dd..2aa39bba03a 100644
--- a/web/src/filter.ts
+++ b/web/src/filter.ts
@@ -1626,10 +1626,8 @@ export class Filter {
return new Filter(terms);
}
- has_topic(stream_id: number, topic: string): boolean {
- return (
- this.has_operand("channel", stream_id.toString()) && this.has_operand("topic", topic)
- );
+ has_topic(stream_id: string, topic: string): boolean {
+ return this.has_operand("channel", stream_id) && this.has_operand("topic", topic);
}
sorted_term_types(): string[] {
diff --git a/web/src/message_events.ts b/web/src/message_events.ts
index 919f9428a52..920337336a8 100644
--- a/web/src/message_events.ts
+++ b/web/src/message_events.ts
@@ -679,7 +679,7 @@ export function update_messages(events: UpdateMessageEvent[]): void {
// Code further down takes care of the actual rerendering of
// messages within a narrow.
selection_changed_topic &&
- current_filter?.has_topic(old_stream_id, orig_topic)
+ current_filter?.has_topic(String(old_stream_id), orig_topic)
) {
let new_filter = current_filter;
if (new_filter && stream_changed) {