Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: hook lint error

Marc Seitz8fdf478df4bb
diff --git a/pages/view/[linkId].tsx b/pages/view/[linkId].tsx
index 89bc6e34..daa7f434 100644
--- a/pages/view/[linkId].tsx
+++ b/pages/view/[linkId].tsx
@@ -36,10 +36,6 @@ export default function DocumentView() {
DEFAULT_ACCESS_FORM_DATA
);
- if (error && error.status === 404) {
- return <ErrorPage statusCode={404} />;
- }
-
useEffect(() => {
const userEmail = session?.user?.email;
if (userEmail) {
@@ -50,6 +46,10 @@ export default function DocumentView() {
}
}, [session]);
+ if (error && error.status === 404) {
+ return <ErrorPage statusCode={404} />;
+ }
+
if (!link) {
return <div>Loading...</div>;
}