Skip to content

Commit 28e48d1

Browse files
committed
chore: migrate Workspace to OWWS
1 parent b1d572f commit 28e48d1

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

site/src/pages/WorkspacePage/WorkspacePage.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,16 @@ export const WorkspacePage: FC = () => {
8282
return;
8383
}
8484

85-
const eventSource = watchWorkspace(workspaceId);
86-
87-
eventSource.addEventListener("data", async (event) => {
85+
const socket = watchWorkspace(workspaceId);
86+
socket.addEventListener("message", (event) => {
8887
const newWorkspaceData = JSON.parse(event.data) as Workspace;
89-
await updateWorkspaceData(newWorkspaceData);
88+
void updateWorkspaceData(newWorkspaceData);
9089
});
91-
92-
eventSource.addEventListener("error", (event) => {
90+
socket.addEventListener("error", (event) => {
9391
console.error("Error on getting workspace changes.", event);
9492
});
9593

96-
return () => {
97-
eventSource.close();
98-
};
94+
return () => socket.close();
9995
}, [updateWorkspaceData, workspaceId]);
10096

10197
// Page statuses

0 commit comments

Comments
 (0)