Fix duplicated willTransition actions from merge

This commit is contained in:
Kevin Ansfield 2017-11-07 12:25:17 +00:00
parent 704be46266
commit 435438a43e

View File

@ -33,11 +33,6 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
},
actions: {
willTransition() {
this.controller.set('user.password', '');
this.controller.set('user.newPassword', '');
this.controller.set('user.ne2Password', '');
},
didTransition() {
this.modelFor('team.user').get('errors').clear();
},
@ -52,6 +47,11 @@ export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
let dirtyAttributes = controller.get('dirtyAttributes');
let modelIsDirty = user.get('hasDirtyAttributes');
// always reset the password properties on the user model when leaving
user.set('user.password', '');
user.set('user.newPassword', '');
user.set('user.ne2Password', '');
if (modelIsDirty || dirtyAttributes) {
transition.abort();
controller.send('toggleLeaveSettingsModal', transition);