✌️
This commit is contained in:
@@ -444,7 +444,7 @@ export default class MiOS extends EventEmitter {
|
||||
// Append a credential
|
||||
if (this.isSignedIn) (data as any).i = this.i.token;
|
||||
|
||||
const viaStream = localStorage.getItem('enableExperimental') == 'true';
|
||||
const viaStream = localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
if (viaStream) {
|
||||
@@ -452,6 +452,8 @@ export default class MiOS extends EventEmitter {
|
||||
const id = Math.random().toString();
|
||||
|
||||
stream.once(`api-res:${id}`, res => {
|
||||
if (--pending === 0) spinner.parentNode.removeChild(spinner);
|
||||
|
||||
if (res.res) {
|
||||
resolve(res.res);
|
||||
} else {
|
||||
@@ -503,7 +505,7 @@ export default class MiOS extends EventEmitter {
|
||||
reject(body.error);
|
||||
}
|
||||
}).catch(reject);
|
||||
/*}*/
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user