diff --git a/frontend/client/src/views/modals/change-password.js b/frontend/client/src/views/modals/change-password.js index d5095dee22..1b8ea2ae52 100644 --- a/frontend/client/src/views/modals/change-password.js +++ b/frontend/client/src/views/modals/change-password.js @@ -105,13 +105,9 @@ Espo.define('Views.Modals.ChangePassword', 'Views.Modal', function (Dep) { this.$el.find('button[data-name="change"]').removeClass('disabled'); }.bind(this) }).done(function () { - Espo.Ui.success(this.translate('passwordChanged', 'messages', 'User')); - - setTimeout(function () { - this.getBaseController().logout(); - this.close(); - }.bind(this), 2000); - + Espo.Ui.success(this.translate('passwordChanged', 'messages', 'User')); + this.trigger('changed'); + this.close(); }.bind(this)); }, diff --git a/frontend/client/src/views/user/record/detail.js b/frontend/client/src/views/user/record/detail.js index 1561eeaab9..c46165e98e 100644 --- a/frontend/client/src/views/user/record/detail.js +++ b/frontend/client/src/views/user/record/detail.js @@ -71,6 +71,13 @@ Espo.define('Views.User.Record.Detail', 'Views.Record.Detail', function (Dep) { }, function (view) { view.render(); this.notify(false); + + this.listenToOnce(view, 'changed', function () { + setTimeout(function () { + this.getBaseController().logout(); + }.bind(this), 2000); + }, this); + }.bind(this)); }, @@ -93,7 +100,7 @@ Espo.define('Views.User.Record.Detail', 'Views.Record.Detail', function (Dep) { model: this.model, }, function (view) { this.notify(false); - view.render(); + view.render(); }.bind(this)); }.bind(this));