From 3701c99b0ae886d283fff560997c840c9971bc2e Mon Sep 17 00:00:00 2001 From: Sayam Samal Date: Fri, 21 Mar 2025 20:26:54 +0530 Subject: [PATCH] popup_banners: Update connection error banner label. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the connection error banner label to "Unable to connect to Zulip. Trying to reconnect soon…" when the user manually retries the connection via the "Try now" button and when the retry time is less than 5 seconds. And updates the countdown label of the same banner to "Unable to connect to Zulip. Trying to reconnect in {retry_delay_secs} seconds…". --- web/src/popup_banners.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/popup_banners.ts b/web/src/popup_banners.ts index 2faeba1a42..1b4d0dc89a 100644 --- a/web/src/popup_banners.ts +++ b/web/src/popup_banners.ts @@ -21,14 +21,14 @@ function fade_out_popup_banner($banner: JQuery): void { const get_connection_error_label = (retry_delay_secs: number): string => { if (original_retry_delay_secs < 5) { // When the retry delay is less than 5 seconds, we don't show the retry - // delay time in the banner, and instead just show "Retrying soon…" to - // constant flickering of the banner label for very short times. - return $t({defaultMessage: "Unable to connect to Zulip. Retrying soon…"}); + // delay time in the banner, and instead just show "Trying to reconnect soon…" + // to avoid constant flickering of the banner label for very short times. + return $t({defaultMessage: "Unable to connect to Zulip. Trying to reconnect soon…"}); } return $t( { defaultMessage: - "Unable to connect to Zulip. {retry_delay_secs, plural, one {Trying again in {retry_delay_secs} second…} other {Trying again in {retry_delay_secs} seconds…}}", + "Unable to connect to Zulip. {retry_delay_secs, plural, one {Trying to reconnect in {retry_delay_secs} second…} other {Trying to reconnect in {retry_delay_secs} seconds…}}", }, {retry_delay_secs}, ); @@ -139,7 +139,7 @@ function retry_connection_click_handler(e: JQuery.ClickEvent, on_retry_callback: const $banner = $(e.currentTarget).closest(".banner"); $banner .find(".banner-label") - .text($t({defaultMessage: "Unable to connect to Zulip. Retrying now…"})); + .text($t({defaultMessage: "Unable to connect to Zulip. Trying to reconnect soon…"})); const $button = $(e.currentTarget).closest(".retry-connection");