Skip to content

Commit

Permalink
fix: websocket url
Browse files Browse the repository at this point in the history
  • Loading branch information
nusr committed Jan 6, 2025
1 parent 19cc16d commit cdbf605
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions demo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,9 @@ const docId =
const doc = initDoc({ guid: docId });
location.hash = `#${docId}`;

// Github Pages no server
const isCI = Boolean(process.env.CI);

const webSocket = new WebsocketProvider(
isCI ? '' : 'ws://localhost:1234',
doc.guid,
doc,
{
connect: false,
},
);
const webSocket = new WebsocketProvider('ws://localhost:1234', doc.guid, doc, {
connect: false,
});

webSocket.connect();
webSocket.awareness.on('update', () => {
Expand Down Expand Up @@ -67,7 +59,7 @@ doc.on('update', (_a, _b, _c, tran) => {
(window as any).doc = doc;
(window as any).version = version;

const provider = isCI ? undefined : new Provider();
const provider = process.env.CI ? undefined : new Provider();

createRoot(document.getElementById('root')!).render(
<StrictMode>
Expand Down

0 comments on commit cdbf605

Please sign in to comment.