Commit e028fa0c by Sixong.Zhu

u

parent c7763c7d
Showing with 3 additions and 3 deletions
...@@ -145,13 +145,13 @@ class Chat { ...@@ -145,13 +145,13 @@ class Chat {
if (xim.isConnected()) { if (xim.isConnected()) {
return Promise.resolve(uri); return Promise.resolve(uri);
} }
return new Promise<void>((resolve) => { return new Promise<void>((resolve, reject) => {
xim.open(uri, this.token).finally(() => { xim.open(uri, this.token).catch(reject).finally(() => {
this.registerXimEvent(); this.registerXimEvent();
if (xim.isConnected()) { if (xim.isConnected()) {
resolve(); resolve();
} else { } 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