Skip to content

Commit 08f96fd

Browse files
committed
fix: close ws if connection is cancelled during open
1 parent a2f22c8 commit 08f96fd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/bee.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,12 @@ export class Bee {
13851385
}
13861386

13871387
ws.onopen = () => {
1388+
if (cancelled) {
1389+
ws.close()
1390+
1391+
return
1392+
}
1393+
13881394
startPing()
13891395
flushQueue()
13901396

0 commit comments

Comments
 (0)