Skip to content

Commit

Permalink
handle browser case for udp socket
Browse files Browse the repository at this point in the history
  • Loading branch information
foomoon committed Dec 14, 2023
1 parent 231991d commit d8f1fd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ export class Light {
timeout: timeout,
});
this.activeLoginCall = false;
this.udpClient = udp.createSocket("udp4");
if (typeof window === "undefined") {
this.udpClient = udp.createSocket("udp4");
} else {
this.udpClient = new udp.Socket();
}
}
async autoEndLoginCall(): Promise<void> {
await delay(1000);
Expand Down

0 comments on commit d8f1fd6

Please sign in to comment.