Skip to content

Commit 252a6df

Browse files
committed
initialize machine context in the hook
1 parent ae1c58a commit 252a6df

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

site/src/pages/WorkspacePage/WorkspacePage.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ export const WorkspacePage: React.FC = () => {
2121
const xServices = useContext(XServiceContext)
2222
const me = useSelector(xServices.authXService, selectUser)
2323

24-
const [workspaceState, workspaceSend] = useMachine(
25-
workspaceMachine.withContext({
26-
...workspaceMachine.initialState.context,
24+
const [workspaceState, workspaceSend] = useMachine(workspaceMachine, {
25+
context: {
2726
userId: me?.id,
28-
}),
29-
)
27+
},
28+
})
3029
const { workspace, resources, getWorkspaceError, getResourcesError, builds, permissions } = workspaceState.context
3130

3231
const canUpdateWorkspace = !!permissions?.updateWorkspace

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy