empty_feed_notice: Add support for empty string topic.

Earlier, we were not showing `realm_empty_topic_display_name`
value in the empty_feed_notice.
This commit is contained in:
Prakhar Pratyush
2025-02-18 21:57:50 +05:30
committed by Tim Abbott
parent 82646c4d96
commit 22efac5a77
3 changed files with 8 additions and 2 deletions

View File

@@ -82,8 +82,9 @@ function retrieve_search_query_data(): SearchData {
const stream_name = stream_data.get_valid_sub_by_id_string(stream_id).name;
search_string_result.stream_query = stream_name;
}
if (topic) {
search_string_result.topic_query = topic;
if (topic !== undefined) {
search_string_result.topic_query = util.get_final_topic_display_name(topic);
search_string_result.is_empty_string_topic = topic === "";
}
}

View File

@@ -10,6 +10,7 @@ export type SearchData = {
has_stop_word: boolean;
stream_query?: string;
topic_query?: string;
is_empty_string_topic?: boolean;
};
export type NarrowBannerData = {

View File

@@ -7,8 +7,12 @@
<span>channel: {{search_data.stream_query}}</span>
{{/if}}
{{#if search_data.topic_query}}
{{#if search_data.is_empty_string_topic}}
<span>topic: <span class="empty-topic-display">{{search_data.topic_query}}</span></span>
{{else}}
<span>topic: {{search_data.topic_query}}</span>
{{/if}}
{{/if}}
{{#each search_data.query_words}}
{{#if is_stop_word}}
<del>{{query_word}}</del>