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.

banners: Close the timezone banner after the user selects an option.

Saubhagya Patel6d51b800865f
diff --git a/web/src/navbar_alerts.ts b/web/src/navbar_alerts.ts
index 60e34cdc88b..df772b6fc88 100644
--- a/web/src/navbar_alerts.ts
+++ b/web/src/navbar_alerts.ts
@@ -512,11 +512,12 @@ export function initialize(): void {
"click",
".accept-update-time-zone",
function (this: HTMLElement) {
+ const $banner = $(this).closest(".banner");
void channel.patch({
url: "/json/settings",
data: {timezone: browser_time_zone},
- success: () => {
- banners.close($(this));
+ success() {
+ banners.close($banner);
feedback_widget.show({
title_text: $t({defaultMessage: "Time zone updated"}),
populate($container) {
@@ -550,11 +551,12 @@ export function initialize(): void {
"click",
".decline-time-zone-update",
function (this: HTMLElement) {
+ const $banner = $(this).closest(".banner");
void channel.patch({
url: "/json/settings",
data: {web_suggest_update_timezone: false},
- success: () => {
- banners.close($(this));
+ success() {
+ banners.close($banner);
feedback_widget.show({
title_text: $t({defaultMessage: "Setting updated"}),
populate($container) {