mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
recent_topics: Show loading indicator before fetching initial messages.
Hide the loading indicator after initial fetch for recent topics.
This commit is contained in:
@@ -8,6 +8,7 @@ import * as compose_closed_ui from "./compose_closed_ui";
|
||||
import * as hash_util from "./hash_util";
|
||||
import {$t} from "./i18n";
|
||||
import * as ListWidget from "./list_widget";
|
||||
import * as loading from "./loading";
|
||||
import {localstorage} from "./localstorage";
|
||||
import * as message_store from "./message_store";
|
||||
import * as message_util from "./message_util";
|
||||
@@ -208,6 +209,19 @@ export function revive_current_focus() {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function show_loading_indicator() {
|
||||
loading.make_indicator($("#recent_topics_loading_messages_indicator"));
|
||||
}
|
||||
|
||||
export function hide_loading_indicator() {
|
||||
$("#recent_topics_bottom_whitespace").hide();
|
||||
loading.destroy_indicator($("#recent_topics_loading_messages_indicator"), {
|
||||
abs_positioned: false,
|
||||
});
|
||||
// Show empty table text if there are no messages fetched.
|
||||
$("#recent_topics_table tbody").addClass("required-text");
|
||||
}
|
||||
|
||||
export function process_messages(messages) {
|
||||
// While this is inexpensive and handles all the cases itself,
|
||||
// the UX can be bad if user wants to scroll down the list as
|
||||
|
||||
Reference in New Issue
Block a user