Skip to content

Commit 74316ab

Browse files
committed
Clarify comment
1 parent 5450b51 commit 74316ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sim/webxdc.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ const webXdc: WebXdc = {
3030
socket.removeEventListener("open", currentOpenEventListener);
3131
}
3232

33-
// if the socket is connecting, we send the information
34-
// as soon as we're open
3533
if (socket.readyState === 0) {
34+
// if the socket is connecting, we send the information
35+
// as soon as we're open
3636
const openEventListener = (): void => {
3737
socket.send(JSON.stringify({ type: "setUpdateListener", serial }));
3838
};
3939
currentOpenEventListener = openEventListener;
4040
socket.addEventListener("open", openEventListener);
4141
} else if (socket.readyState === 1) {
42-
// if it's open, we send the information immediately
42+
// if it's already open, we send the information immediately
4343
socket.send(JSON.stringify({ type: "setUpdateListener", serial }));
4444
} else {
4545
throw new Error("Cannot access socket to register setUpdateListener");

0 commit comments

Comments
 (0)