Skip to content

Commit 72385f9

Browse files
committed
refactor: simplify socket URL determination by removing unnecessary function
1 parent e52e8ce commit 72385f9

File tree

1 file changed

+1
-7
lines changed
  • scratch-arduino-extensions/packages/scratch-vm/src/extensions/arduino_object_detection

1 file changed

+1
-7
lines changed

scratch-arduino-extensions/packages/scratch-vm/src/extensions/arduino_object_detection/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ const iconURI = "";
2323
const menuIconURI = "";
2424

2525
// Determine the appropriate protocol and URL for socket.io connection
26-
const getSocketURL = () => {
27-
const protocol = window.location.protocol === 'https:' ? 'https:' : 'http:';
28-
const hostname = window.location.hostname || '192.168.1.39';
29-
const port = 7000;
30-
return `${protocol}//${hostname}:${port}`;
31-
};
26+
const wsServerURL = `${window.location.protocol}//${window.location.hostname}:7000`;
3227

33-
const wsServerURL = getSocketURL();
3428

3529
/**
3630
* RGB color constants for confidence visualization

0 commit comments

Comments
 (0)