Only dispatch password_changed when password has changed

pull/3982/head
Luke Barnard 2017-05-16 14:24:09 +01:00
parent c6ff45261d
commit 219bfffea2
2 changed files with 5 additions and 2 deletions

View File

@ -38,7 +38,7 @@ export default React.createClass({
},
_onPasswordChanged: function() {
this.props.onFinished();
this.props.onFinished(true);
},
_onPasswordChangeError: function(err) {

View File

@ -25,7 +25,10 @@ export default React.createClass({
onUpdateClicked: function() {
const SetPasswordDialog = sdk.getComponent('dialogs.SetPasswordDialog');
Modal.createDialog(SetPasswordDialog, {
onFinished: () => {
onFinished: (passwordChanged) => {
if (!passwordChanged) {
return;
}
// Notify SessionStore that the user's password was changed
dis.dispatch({
action: 'password_changed',