filter: Standardize type of has_topic's stream_id.

This commit is contained in:
Evy Kassirer
2025-09-19 11:25:02 -07:00
committed by Tim Abbott
parent a8387a6487
commit 02f1a624f7
2 changed files with 3 additions and 5 deletions

View File

@@ -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[] {

View File

@@ -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) {