File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
components/dashboard/src/workspaces Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -66,12 +66,20 @@ export function CreateWorkspacePage() {
66
66
) ;
67
67
const workspaceContext = useWorkspaceContext ( contextURL ) ;
68
68
const isLoading = workspaceContext . isLoading || projects . isLoading ;
69
+
70
+ // see if we have a matching project based on context url and project's repo url
69
71
const project = useMemo ( ( ) => {
70
72
if ( ! workspaceContext . data || ! projects . data ) {
71
73
return undefined ;
72
74
}
73
- const cloneUrl = ( workspaceContext . data as CommitContext ) . repository . cloneUrl ;
74
- return projects . data . projects . find ( ( p ) => p . cloneUrl === cloneUrl ) ;
75
+ if ( "repository" in workspaceContext . data ) {
76
+ const cloneUrl = ( workspaceContext . data as CommitContext ) ?. repository ?. cloneUrl ;
77
+ if ( ! cloneUrl ) {
78
+ return ;
79
+ }
80
+
81
+ return projects . data . projects . find ( ( p ) => p . cloneUrl === cloneUrl ) ;
82
+ }
75
83
} , [ projects . data , workspaceContext . data ] ) ;
76
84
77
85
useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments