DEV: Ignore timezone cache when getting current timezone (#30861)

When the user selects “Use Current Timezone” on Profile -> Preferences
-> Profile, a call is made to `moment.tz.guess()`.


https://momentjs.com/timezone/docs/#/using-timezones/guessing-user-timezone/
states that, by default, previously cached responses from this function
will be returned upon subsequent calls. If your physical location has
changed, this may result in a cached value being returned, and thus the
timezone seemingly not being updating.

By passing the `true` value to the function, the cache is bypassed,
forcing an explicit recheck of the current timezone.
This commit is contained in:
jbrw 2025-01-20 15:42:08 +11:00 committed by GitHub
parent 7ae5d03a2c
commit a39b6daa65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ export default class ProfileController extends Controller {
@action
useCurrentTimezone() {
this.model.set("user_option.timezone", moment.tz.guess());
this.model.set("user_option.timezone", moment.tz.guess(true));
}
@action