From 63fd8e58b2f141d3a6211f4f6ce3620220813eed Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 8 Jan 2021 12:00:00 +0100 Subject: [PATCH] gui: masks for: adding recovery and removals Signed-off-by: Wolfgang Bumiller --- www/config/TfaView.js | 5 ++++- www/window/AddTfaRecovery.js | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/www/config/TfaView.js b/www/config/TfaView.js index a4c289dc..9188ae52 100644 --- a/www/config/TfaView.js +++ b/www/config/TfaView.js @@ -161,6 +161,7 @@ Ext.define('PBS.config.TfaView', { } try { + me.getView().mask(gettext('Please wait...'), 'x-mask-loading'); await PBS.Async.api2({ url: `/api2/extjs/access/tfa/${record.id}`, method: 'DELETE', @@ -169,7 +170,9 @@ Ext.define('PBS.config.TfaView', { me.reload(); } catch (error) { Ext.Msg.alert(gettext('Error'), error); - } + } finally { + me.getView().unmask(); + } }, }, diff --git a/www/window/AddTfaRecovery.js b/www/window/AddTfaRecovery.js index 1dc81f86..710c243f 100644 --- a/www/window/AddTfaRecovery.js +++ b/www/window/AddTfaRecovery.js @@ -74,6 +74,8 @@ Ext.define('PBS.window.AddTfaRecovery', { let me = this; let view = me.getView(); + view.mask(gettext('Please wait...'), 'x-mask-loading'); + let baseurl = view.baseurl; let userid = me.userid; @@ -87,8 +89,6 @@ Ext.define('PBS.window.AddTfaRecovery', { params.password = me.lookup('password').getValue(); } - me.getView().close(); - try { let response = await PBS.Async.api2({ url: `${baseurl}/${userid}`, @@ -102,6 +102,8 @@ Ext.define('PBS.window.AddTfaRecovery', { }); } catch (ex) { Ext.Msg.alert(gettext('Error'), ex); + } finally { + view.close(); } }, },