From e2600e4b3694d542470635ffac74fd9093f6566b Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 18 Jul 2018 15:53:12 +0200 Subject: [PATCH] display a loading screen while users are changing their passwords --- customize.dist/translations/messages.js | 1 + www/settings/inner.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index b16e6d876..ac3ba63fd 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -614,6 +614,7 @@ define(function () { out.settings_changePasswordNewConfirm = "Confirm new password"; out.settings_changePasswordConfirm = "Are you sure you want to change your password? You will need to log back in on all your devices."; out.settings_changePasswordError = "An unexpected error occurred. If you are unable to login or change your password, contact your CryptPad administrators."; + out.settings_changePasswordPending = "Your password is being updated. Please do not close or reload this page until the process has completed."; out.upload_title = "File upload"; out.upload_modal_title = "File upload options"; diff --git a/www/settings/inner.js b/www/settings/inner.js index e3abd389b..407ee5fdb 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -431,10 +431,16 @@ define([ UI.confirm(Messages.settings_changePasswordConfirm, function (yes) { if (!yes) { return; } + + UI.addLoadingScreen({ + hideTips: true, + loadingText: Messages.settings_changePasswordPending, + }); updateBlock({ password: oldPassword, newPassword: newPassword }, function (obj) { + UI.removeLoadingScreen(); if (obj && obj.error) { // TODO UI.alert(Messages.settings_changePasswordError);