fix: undefined error

This commit is contained in:
huzibaca
2024-11-12 19:34:53 +08:00
Unverified
parent 8763a76475
commit a681fdeee1

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);
}