ui: use Async tools from widget toolkit

The api2 one passes the whole response (for more flexibility) on
reject, so we need to adapt to that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2021-07-09 16:53:11 +02:00
parent 681e096448
commit 3006d70ebe
7 changed files with 26 additions and 50 deletions

View File

@ -51,12 +51,12 @@ Ext.define('PBS.window.AddTfaRecovery', {
let view = me.getView();
try {
await PBS.Async.api2({
await Proxmox.Async.api2({
url: `${view.url}/${userid}/recovery`,
method: 'GET',
});
return true;
} catch (_ex) {
} catch (_response) {
return false;
}
},