FIX: Don't override timezone on every visit of profile preferences
The timezone should only be initialized when there is no timezone stored in the DB yet. This also fixes an error that happened in dev mode whenever you switch between user preference tabs.
This commit is contained in:
parent
0d08eac1c7
commit
3fc589f875
|
@ -3,8 +3,10 @@ import RestrictedUserRoute from "discourse/routes/restricted-user";
|
||||||
export default RestrictedUserRoute.extend({
|
export default RestrictedUserRoute.extend({
|
||||||
showFooter: true,
|
showFooter: true,
|
||||||
setupController(controller, model) {
|
setupController(controller, model) {
|
||||||
model.user_option.timezone =
|
if (!model.user_option.timezone) {
|
||||||
model.user_option.timezone || moment.tz.guess();
|
Ember.set(model, "user_option.timezone", moment.tz.guess());
|
||||||
|
}
|
||||||
|
|
||||||
controller.set("model", model);
|
controller.set("model", model);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue