Commit e028fa0c by Sixong.Zhu

u

parent c7763c7d
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