Commit 1b46cabe by zhousil

Merge branch 'master' into pre

parents a7483b91 e028fa0c
Showing with 3 additions and 3 deletions
......@@ -145,13 +145,13 @@ class Chat {
if (xim.isConnected()) {
return Promise.resolve(uri);
}
return new Promise<void>((resolve) => {
xim.open(uri, this.token).finally(() => {
return new Promise<void>((resolve, reject) => {
xim.open(uri, this.token).catch(reject).finally(() => {
this.registerXimEvent();
if (xim.isConnected()) {
resolve();
} else {
setTimeout(() => resolve(), 2000);
reject(new Error(`xim is not connected`));
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment