mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
v5 release
Supported locales: English and German.
This commit is contained in:
parent
b77b4abdc2
commit
38a790dd04
4 changed files with 20 additions and 5 deletions
|
@ -21,6 +21,7 @@ import Component from '@ember/component';
|
|||
|
||||
export default Component.extend(AuthProvider, {
|
||||
appMeta: service(),
|
||||
router: service(),
|
||||
hasFirstnameError: empty('model.firstname'),
|
||||
hasLastnameError: empty('model.lastname'),
|
||||
hasEmailError: computed('model.email', function() {
|
||||
|
@ -49,6 +50,7 @@ export default Component.extend(AuthProvider, {
|
|||
}),
|
||||
locale: { name: '' },
|
||||
locales: null,
|
||||
localChanged: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
@ -73,6 +75,8 @@ export default Component.extend(AuthProvider, {
|
|||
actions: {
|
||||
onSelectLocale(locale) {
|
||||
this.set('model.locale', locale.name);
|
||||
|
||||
this.localChanged = true;
|
||||
},
|
||||
|
||||
save() {
|
||||
|
@ -107,6 +111,10 @@ export default Component.extend(AuthProvider, {
|
|||
this.get('save')(passwords).finally(() => {
|
||||
set(this, 'password.password', '');
|
||||
set(this, 'password.confirmation', '');
|
||||
|
||||
if (this.localChanged) {
|
||||
this.get('router').transitionTo('auth.logout');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue