We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3afd5f8 commit 4f31705Copy full SHA for 4f31705
apps/webapp/app/hooks/useEnvironments.ts
@@ -1,5 +1,6 @@
1
import { RouteMatch } from "@remix-run/react";
2
import { MatchedProject, useOptionalProject } from "./useProject";
3
+import { useUser } from "./useUser";
4
5
export type ProjectJobEnvironment = MatchedProject["environments"][number];
6
@@ -11,10 +12,13 @@ export function useEnvironments(matches?: RouteMatch[]) {
11
12
}
13
14
export function useDevEnvironment(matches?: RouteMatch[]) {
15
+ const user = useUser();
16
const environments = useEnvironments(matches);
17
if (!environments) return;
18
- return environments.find((environment) => environment.type === "DEVELOPMENT");
19
+ return environments.find(
20
+ (environment) => environment.type === "DEVELOPMENT" && environment.userId === user.id
21
+ );
22
23
24
export function useProdEnvironment(matches?: RouteMatch[]) {
0 commit comments