mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -93,6 +93,12 @@ export default Controller.extend(PreferencesTabController, {
|
||||
return model
|
||||
.save(this.saveAttrNames)
|
||||
.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"))
|
||||
.then(() => {
|
||||
model.set("bio_cooked");
|
||||
|
||||
Reference in New Issue
Block a user