Skip to content

Commit 24fdd15

Browse files
committed
workspace machine cleanup
1 parent a813f7f commit 24fdd15

File tree

3 files changed

+91
-214
lines changed

3 files changed

+91
-214
lines changed

site/src/api/api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ export const getWorkspace = async (
203203
return response.data
204204
}
205205

206+
export const watchWorkspace = (workspaceId: string): EventSource => {
207+
return new EventSource(`${location.protocol}//${location.host}/api/v2/workspaces/${workspaceId}/watch`,
208+
{ withCredentials: true }
209+
)
210+
}
211+
206212
export const getURLWithSearchParams = (
207213
basePath: string,
208214
filter?: TypesGen.WorkspaceFilter | TypesGen.UsersRequest,

site/src/pages/WorkspacePage/WorkspacePage.tsx

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -51,44 +51,6 @@ export const WorkspacePage: FC = () => {
5151
cancellationError,
5252
} = workspaceState.context
5353

54-
useEffect(() => {
55-
// console.log("workspace updating in component", workspace)
56-
// console.log("resources", resources)
57-
}, [workspace, resources])
58-
59-
// useEffect(() => {
60-
// if (!workspace?.id) {
61-
// return
62-
// }
63-
//
64-
// console.log("hey im in here")
65-
// const sse = new EventSource(
66-
// `${location.protocol}//${location.host}/api/v2/workspaces/${workspace.id}/watch`,
67-
// { withCredentials: true },
68-
// )
69-
//
70-
// sse.onmessage = (e) => console.log("event", e)
71-
//
72-
// sse.addEventListener("ping", (event) => {
73-
// console.log("ping event", event)
74-
// })
75-
//
76-
// sse.addEventListener("data", (event) => {
77-
// console.log("data event", event)
78-
// })
79-
//
80-
// sse.onerror = (error) => {
81-
// // error log here
82-
// console.log("error", error)
83-
//
84-
// sse.close()
85-
// }
86-
//
87-
// return () => {
88-
// sse.close()
89-
// }
90-
// }, [workspace])
91-
9254
const canUpdateWorkspace = Boolean(permissions?.updateWorkspace)
9355

9456
const [bannerState, bannerSend] = useMachine(workspaceScheduleBannerMachine)

0 commit comments

Comments
 (0)