mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
popup_banners: Update connection error banner label.
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…".
This commit is contained in:
@@ -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");
|
||||
|
||||
|
Reference in New Issue
Block a user