Commit 0fe3cc80 by 吴云建

fix

parent 538a1837
Showing with 6 additions and 4 deletions
......@@ -48,10 +48,11 @@ export class Xim {
if (this.client.connected) {
this.client.close();
}
this.client.onconnected = emptyFunc;
this.client.onmsg = emptyFunc;
this.client = undefined;
if (this.client) {
this.client.onconnected = emptyFunc;
this.client.onmsg = emptyFunc;
this.client = undefined;
}
}
}
......@@ -64,6 +65,7 @@ export class Xim {
this.close();
token().then((t) => {
if (!t) return;
const client = new XChatClient(url, this.trimToken(t));
this.client = client;
......
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