From 219bfffea293ed3f4171df130d5f4da1464bbd12 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 16 May 2017 14:24:09 +0100 Subject: [PATCH] Only dispatch password_changed when password has changed --- src/components/views/dialogs/SetPasswordDialog.js | 2 +- src/components/views/globals/PasswordNagBar.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/SetPasswordDialog.js b/src/components/views/dialogs/SetPasswordDialog.js index a0b6fd1e37..e0bbee7da5 100644 --- a/src/components/views/dialogs/SetPasswordDialog.js +++ b/src/components/views/dialogs/SetPasswordDialog.js @@ -38,7 +38,7 @@ export default React.createClass({ }, _onPasswordChanged: function() { - this.props.onFinished(); + this.props.onFinished(true); }, _onPasswordChangeError: function(err) { diff --git a/src/components/views/globals/PasswordNagBar.js b/src/components/views/globals/PasswordNagBar.js index 3fd0191a31..f0fdee6c56 100644 --- a/src/components/views/globals/PasswordNagBar.js +++ b/src/components/views/globals/PasswordNagBar.js @@ -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',