This commit is contained in:
syuilo
2018-04-13 09:44:00 +09:00
parent 61f21594a9
commit 22d2f2051c
10 changed files with 40 additions and 26 deletions

View File

@ -444,9 +444,10 @@ export default class MiOS extends EventEmitter {
// Append a credential
if (this.isSignedIn) (data as any).i = this.i.token;
const viaStream = localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true;
return new Promise((resolve, reject) => {
const viaStream = this.stream.hasConnection &&
(localStorage.getItem('apiViaStream') ? localStorage.getItem('apiViaStream') == 'true' : true);
if (viaStream) {
const stream = this.stream.borrow();
const id = Math.random().toString();