File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 11import { RouteMatch } from "@remix-run/react" ;
22import { MatchedProject , useOptionalProject } from "./useProject" ;
3+ import { useUser } from "./useUser" ;
34
45export type ProjectJobEnvironment = MatchedProject [ "environments" ] [ number ] ;
56
@@ -11,10 +12,13 @@ export function useEnvironments(matches?: RouteMatch[]) {
1112}
1213
1314export function useDevEnvironment ( matches ?: RouteMatch [ ] ) {
15+ const user = useUser ( ) ;
1416 const environments = useEnvironments ( matches ) ;
1517 if ( ! environments ) return ;
1618
17- return environments . find ( ( environment ) => environment . type === "DEVELOPMENT" ) ;
19+ return environments . find (
20+ ( environment ) => environment . type === "DEVELOPMENT" && environment . userId === user . id
21+ ) ;
1822}
1923
2024export function useProdEnvironment ( matches ?: RouteMatch [ ] ) {
You can’t perform that action at this time.
0 commit comments