fix: undefined error

This commit is contained in:
huzibaca 2024-11-12 19:34:53 +08:00
parent 8763a76475
commit a681fdeee1
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302

View File

@ -23,8 +23,10 @@ export const createSockette = (
remainRetryCount -= 1;
if (remainRetryCount >= 0) {
this.close();
this.reconnect();
if (this instanceof Sockette) {
this.close();
this.reconnect();
}
} else {
opt.onerror?.call(this, ev);
}