From 88f71f28cc07d50ea6db9f82046f97094ad23830 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Wed, 9 Apr 2025 16:58:49 +0530 Subject: [PATCH] topic_list: Add method to check if topic list is empty. --- web/src/topic_list.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/topic_list.ts b/web/src/topic_list.ts index d5ab4e8f5a..21ce7399da 100644 --- a/web/src/topic_list.ts +++ b/web/src/topic_list.ts @@ -232,6 +232,11 @@ export class TopicListWidget { this.prior_dom = new_dom; } + + is_empty(): boolean { + const $topic_list = this.$parent_elem.find(".topic-list"); + return !$topic_list.hasClass("topic-list-has-topics"); + } } export function clear_topic_search(e: JQuery.Event): void {