Skip to content

Commit

Permalink
Static: Added a message when no result is found.
Browse files Browse the repository at this point in the history
This PR adds a logic check, if the count of length of elems is less than 1, it shows a message.
Fixes-zulip#20797.
  • Loading branch information
Biki-das committed Jan 14, 2022
1 parent 0b8a6a5 commit 42a12c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions static/js/stream_list.js
Expand Up @@ -153,8 +153,12 @@ export function build_stream_list(force_rerender) {
for (const stream_id of stream_groups.dormant_streams) {
add_sidebar_li(stream_id);
}

parent.append(elems);

if (elems.length > 0) {
parent.append(elems);
} else {
parent.append('<div class="stream-not-found"> No search results </div>');
}
}

export function get_stream_li(stream_id) {
Expand Down
6 changes: 6 additions & 0 deletions static/styles/left_sidebar.css
Expand Up @@ -84,6 +84,12 @@ li.show-more-topics {
max-width: 18em;
}

.stream-not-found {
margin-left: 10px;
color: hsl(0, 0%, 67%);
font-style: italic;
}

#stream_filters {
overflow: visible;
margin-bottom: 5px;
Expand Down

0 comments on commit 42a12c7

Please sign in to comment.