From af042a62cd519eb567047c227f38e47bb344c1f2 Mon Sep 17 00:00:00 2001 From: Mythie Date: Thu, 28 Sep 2023 15:45:22 +1000 Subject: [PATCH] fix: disable cancel button when there is no window history --- apps/web/src/app/(signing)/sign/[token]/form.tsx | 1 + packages/lib/server-only/document/viewed-document.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/app/(signing)/sign/[token]/form.tsx b/apps/web/src/app/(signing)/sign/[token]/form.tsx index 74384fd89..3a3feb679 100644 --- a/apps/web/src/app/(signing)/sign/[token]/form.tsx +++ b/apps/web/src/app/(signing)/sign/[token]/form.tsx @@ -120,6 +120,7 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) = className="dark:bg-muted dark:hover:bg-muted/80 w-full bg-black/5 hover:bg-black/10" variant="secondary" size="lg" + disabled={typeof window !== 'undefined' && window.history.length <= 1} onClick={() => router.back()} > Cancel diff --git a/packages/lib/server-only/document/viewed-document.ts b/packages/lib/server-only/document/viewed-document.ts index b16ac138e..5944d4841 100644 --- a/packages/lib/server-only/document/viewed-document.ts +++ b/packages/lib/server-only/document/viewed-document.ts @@ -14,7 +14,6 @@ export const viewedDocument = async ({ token }: ViewedDocumentOptions) => { }); if (!recipient) { - console.warn(`No recipient found for token ${token}`); return; }