diff --git a/apps/console/src/pages/organizations/documents/approve/DocumentApprovePage.tsx b/apps/console/src/pages/organizations/documents/approve/DocumentApprovePage.tsx index fc2e0a5ac..041378849 100644 --- a/apps/console/src/pages/organizations/documents/approve/DocumentApprovePage.tsx +++ b/apps/console/src/pages/organizations/documents/approve/DocumentApprovePage.tsx @@ -38,7 +38,7 @@ import { useMutation, usePreloadedQuery, } from "react-relay"; -import { useNavigate } from "react-router"; +import { Navigate, useNavigate } from "react-router"; import { graphql } from "relay-runtime"; import { useWindowSize } from "usehooks-ts"; @@ -142,6 +142,7 @@ export function DocumentApprovePage(props: { queryRef: PreloadedQuery; }) { const { queryRef } = props; + const organizationId = useOrganizationId(); const data = usePreloadedQuery( documentApprovePageQuery, queryRef, @@ -150,9 +151,10 @@ export function DocumentApprovePage(props: { const document = data.viewer.approvableDocument; if (!document) { return ( -
- -
+ ); } @@ -497,6 +499,15 @@ function DocumentApproveContent({ }; }, [selectedVersion?.id, exportPDF, toast, __]); + if (versions.length === 0) { + return ( + + ); + } + return (
diff --git a/apps/console/src/pages/organizations/employee/EmployeeDocumentSignaturePage.tsx b/apps/console/src/pages/organizations/employee/EmployeeDocumentSignaturePage.tsx index 011c79d24..576b7173f 100644 --- a/apps/console/src/pages/organizations/employee/EmployeeDocumentSignaturePage.tsx +++ b/apps/console/src/pages/organizations/employee/EmployeeDocumentSignaturePage.tsx @@ -15,7 +15,7 @@ import { formatError } from "@probo/helpers"; import { usePageTitle } from "@probo/hooks"; import { useTranslate } from "@probo/i18n"; -import { Card, Spinner, useToast } from "@probo/ui"; +import { Card, useToast } from "@probo/ui"; import { useEffect, useRef, useState } from "react"; import { type PreloadedQuery, @@ -24,7 +24,7 @@ import { usePreloadedQuery, } from "react-relay"; import { graphql } from "react-relay"; -import { useNavigate } from "react-router"; +import { Navigate, useNavigate } from "react-router"; import { useWindowSize } from "usehooks-ts"; import type { EmployeeDocumentSignaturePageDocumentFragment$key } from "#/__generated__/core/EmployeeDocumentSignaturePageDocumentFragment.graphql"; @@ -94,6 +94,7 @@ export function EmployeeDocumentSignaturePage(props: { queryRef: PreloadedQuery; }) { const { queryRef } = props; + const organizationId = useOrganizationId(); const { viewer } = usePreloadedQuery( employeeDocumentSignaturePageQuery, queryRef, @@ -102,9 +103,10 @@ export function EmployeeDocumentSignaturePage(props: { if (!document) { return ( -
- -
+ ); } @@ -232,6 +234,15 @@ function DocumentSignatureContent({ }; }, [selectedVersion?.id, exportEmployeeDocumentVersionPDF, toast, __]); + if (versions.length === 0) { + return ( + + ); + } + return (