left_sidebar: Render brackets only on non-empty channels.

This commit is contained in:
Karl Stolley 2024-08-30 12:01:52 -05:00 committed by Tim Abbott
parent 2c4596d990
commit 776a90d9ba
2 changed files with 9 additions and 3 deletions

View File

@ -166,7 +166,13 @@ export class TopicListWidget {
list_info.items.length === num_possible_topics &&
stream_topic_history.is_complete_for_stream_id(this.my_stream_id);
const attrs: [string, string][] = [["class", "topic-list"]];
const topic_list_classes: [string] = ["topic-list"];
if (list_info.items.length > 0) {
topic_list_classes.push("topic-list-has-topics");
}
const attrs: [string, string][] = [["class", topic_list_classes.join(" ")]];
const nodes = list_info.items.map((conversation) => keyed_topic_li(conversation));

View File

@ -1160,7 +1160,7 @@ ul.topic-list {
font-weight: normal;
}
ul.topic-list::before {
ul.topic-list.topic-list-has-topics::before {
content: " ";
display: block;
position: absolute;
@ -1175,7 +1175,7 @@ ul.topic-list::before {
pointer-events: none;
}
ul.topic-list::after {
ul.topic-list.topic-list-has-topics::after {
content: " ";
display: block;
position: absolute;