Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

recent_view: Extract get_loaded_messages_text helper.

Aman Agrawalb8f39387ecc0
diff --git a/web/src/recent_view_ui.ts b/web/src/recent_view_ui.ts
index 99a3947c4d7..6dc4232508d 100644
--- a/web/src/recent_view_ui.ts
+++ b/web/src/recent_view_ui.ts
@@ -229,6 +229,11 @@ function get_time_string(): string {
);
}
+function get_loaded_messages_text(): string {
+ const time_string = get_time_string();
+ return $t({defaultMessage: "Showing messages since {time_string}."}, {time_string});
+}
+
function update_load_more_banner(): void {
if (loading_state === NO_MESSAGES_LOADED) {
return;
@@ -257,8 +262,7 @@ function update_load_more_banner(): void {
}
const $banner_text = $(".recent-view-load-more-container .last-fetched-message");
- const time_string = get_time_string();
- $banner_text.text($t({defaultMessage: "Showing messages since {time_string}."}, {time_string}));
+ $banner_text.text(get_loaded_messages_text());
if (is_backfill_in_progress) {
// Keep the button disabled and the loading indicator running