Skip to content

Commit a813f7f

Browse files
committed
added error handling
1 parent 72d6731 commit a813f7f

File tree

3 files changed

+219
-111
lines changed

3 files changed

+219
-111
lines changed

site/src/pages/WorkspacePage/WorkspacePage.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,44 @@ 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+
5492
const canUpdateWorkspace = Boolean(permissions?.updateWorkspace)
5593

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

0 commit comments

Comments
 (0)