From db6f88c0a080e9a80fbafd9c842f8835de0d2a93 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 20 Aug 2021 16:52:32 +0200 Subject: [PATCH] Save timezone to current timezone if no timezone is set The preferences showed the detected timezone as the selected timezone if no timezone was null. Now we force set it in that case. Closes #815 Signed-off-by: Thomas Citharel --- js/src/views/Settings/Preferences.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/src/views/Settings/Preferences.vue b/js/src/views/Settings/Preferences.vue index 563d50586..e9f1a0d94 100644 --- a/js/src/views/Settings/Preferences.vue +++ b/js/src/views/Settings/Preferences.vue @@ -144,7 +144,11 @@ export default class Preferences extends Vue { if (this.loggedUser?.settings?.timezone) { return this.loggedUser.settings.timezone; } - return Intl.DateTimeFormat().resolvedOptions().timeZone; + const detectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + if (this.loggedUser?.settings?.timezone === null) { + this.updateUserSettings({ timezone: detectedTimezone }); + } + return detectedTimezone; } set selectedTimezone(selectedTimezone: string) {