File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { RouteMatch } from "@remix-run/react" ;
2
2
import { MatchedProject , useOptionalProject } from "./useProject" ;
3
+ import { useUser } from "./useUser" ;
3
4
4
5
export type ProjectJobEnvironment = MatchedProject [ "environments" ] [ number ] ;
5
6
@@ -11,10 +12,13 @@ export function useEnvironments(matches?: RouteMatch[]) {
11
12
}
12
13
13
14
export function useDevEnvironment ( matches ?: RouteMatch [ ] ) {
15
+ const user = useUser ( ) ;
14
16
const environments = useEnvironments ( matches ) ;
15
17
if ( ! environments ) return ;
16
18
17
- return environments . find ( ( environment ) => environment . type === "DEVELOPMENT" ) ;
19
+ return environments . find (
20
+ ( environment ) => environment . type === "DEVELOPMENT" && environment . userId === user . id
21
+ ) ;
18
22
}
19
23
20
24
export function useProdEnvironment ( matches ?: RouteMatch [ ] ) {
You can’t perform that action at this time.
0 commit comments