mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 22:27:22 +00:00
Update SecretApprovalRequest.tsx
This commit is contained in:
+4
-2
@@ -1,4 +1,5 @@
|
|||||||
import { Fragment, useEffect, useState } from "react";
|
import { Fragment, useEffect, useState } from "react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import {
|
import {
|
||||||
faCheck,
|
faCheck,
|
||||||
faCheckCircle,
|
faCheckCircle,
|
||||||
@@ -65,16 +66,17 @@ export const SecretApprovalRequest = () => {
|
|||||||
const { data: secretApprovalRequestCount, isSuccess: isSecretApprovalReqCountSuccess } =
|
const { data: secretApprovalRequestCount, isSuccess: isSecretApprovalReqCountSuccess } =
|
||||||
useGetSecretApprovalRequestCount({ workspaceId });
|
useGetSecretApprovalRequestCount({ workspaceId });
|
||||||
const { user: userSession } = useUser();
|
const { user: userSession } = useUser();
|
||||||
|
const router = useRouter();
|
||||||
const { permission } = useProjectPermission();
|
const { permission } = useProjectPermission();
|
||||||
const { data: members } = useGetWorkspaceUsers(workspaceId);
|
const { data: members } = useGetWorkspaceUsers(workspaceId);
|
||||||
const isSecretApprovalScreen = Boolean(selectedApprovalId);
|
const isSecretApprovalScreen = Boolean(selectedApprovalId);
|
||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
const requestId = queryParams.get("requestId");
|
const { requestId } = router.query;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!requestId || usingUrlRequestId) return;
|
if (!requestId || usingUrlRequestId) return;
|
||||||
|
|
||||||
setSelectedApprovalId(requestId);
|
setSelectedApprovalId(requestId as string);
|
||||||
setUsingUrlRequestId(true);
|
setUsingUrlRequestId(true);
|
||||||
}, [queryParams]);
|
}, [queryParams]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user