FIX: Set current user timezone when saving profile timezone (#9155)

If you are changing your own profile timezone, then on save we set the current user timezone, in case this property needs to be accessed again before the user is reloaded.
This commit is contained in:
Martin Brennan 2020-03-10 16:57:14 +10:00 committed by GitHub
parent 218d3f5f44
commit e3bbcb27d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -93,6 +93,12 @@ export default Controller.extend(PreferencesTabController, {
return model return model
.save(this.saveAttrNames) .save(this.saveAttrNames)
.then(() => { .then(() => {
// update the timezone in memory so we can use the new
// one if we change routes without reloading the user
if (this.currentUser.id === this.model.id) {
this.currentUser.timezone = this.model.user_option.timezone;
}
cookAsync(model.get("bio_raw")) cookAsync(model.get("bio_raw"))
.then(() => { .then(() => {
model.set("bio_cooked"); model.set("bio_cooked");