Skip to content

Commit e5fe20a

Browse files
committed
fix ws url
1 parent 2f83e45 commit e5fe20a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/graph-framework/src/core.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ export function GraphFramework({ children, accountId, syncServer = 'http://local
8181
const syncServerUrl = new URL(syncServer);
8282
const syncServerWsUrl = new URL(`/?token=${sessionToken}`, syncServerUrl.toString());
8383
syncServerWsUrl.protocol = 'ws:';
84-
const syncServerUrlString = syncServerUrl.toString();
84+
const syncServerWsUrlString = syncServerWsUrl.toString();
8585
// Create a stable WebSocket connection that only depends on accountId
8686
useEffect(() => {
8787
if (!sessionToken) {
8888
return;
8989
}
9090

91-
const websocketConnection = new WebSocket(syncServerUrlString);
91+
const websocketConnection = new WebSocket(syncServerWsUrlString);
9292

9393
setWebsocketConnection(websocketConnection);
9494

@@ -114,7 +114,7 @@ export function GraphFramework({ children, accountId, syncServer = 'http://local
114114
websocketConnection.removeEventListener('close', onClose);
115115
websocketConnection.close();
116116
};
117-
}, [sessionToken, syncServerUrlString]);
117+
}, [sessionToken, syncServerWsUrlString]);
118118

119119
// Handle WebSocket messages in a separate effect
120120
useEffect(() => {

0 commit comments

Comments
 (0)