Skip to content

Commit

Permalink
second adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Dec 9, 2024
1 parent c902746 commit d4a65ee
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/devtools/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ export function startServer(port: number) {
sendToDevTools({ type: "port.changed", port, listening: false });
}),
};
if (serverState) {
if (serverState.port === port) {
// nothing to do
return;
}
// changing port, stop the old server
serverState.disposable.dispose();

if (serverState?.port === port) {
// nothing to do
return;
}
// changing port, stop the old server
serverState?.disposable.dispose();
serverState = state;
let wss: WebSocketServer | null = new WebSocketServer({ port });
wss.on("listening", () => {
Expand Down

0 comments on commit d4a65ee

Please sign in to comment.