Throbber
This commit is contained in:
@@ -284,7 +284,7 @@ export function Client(cid, secret) {
|
||||
|
||||
this.secret = secret;
|
||||
this.cid = cid;
|
||||
this.status = reactive({ connected: true });
|
||||
this.status = reactive({ connected: true, busy: 0 });
|
||||
|
||||
this.close = function() {
|
||||
console.log('CLOSE', cid);
|
||||
@@ -298,7 +298,12 @@ export function Client(cid, secret) {
|
||||
if(body.params) Array.prototype.push.apply(body.params, params);
|
||||
else body.params = params;
|
||||
}
|
||||
var res = await vista.call(cid, body);
|
||||
this.status.busy++;
|
||||
try {
|
||||
var res = await vista.call(cid, body);
|
||||
} finally {
|
||||
this.status.busy--;
|
||||
}
|
||||
if((res.error) && (res.error.type == 'ConnectionResetError')) this.close();
|
||||
res._request = body;
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user