Skip to content

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

fix: missing var in copy clipboard func and wrong var

Marc Seitze4a77fc511ef
diff --git a/components/documents/document-card.tsx b/components/documents/document-card.tsx
index f2eefac0..937e9e61 100644
--- a/components/documents/document-card.tsx
+++ b/components/documents/document-card.tsx
@@ -207,7 +207,7 @@ export default function DocumentsCard({
</div>
<div className="flex flex-row space-x-2">
- {document.type !== "notion" ? (
+ {prismaDocument.type !== "notion" ? (
<button
onClick={(e) => {
e.stopPropagation();
diff --git a/lib/utils/use-copy-to-clipboard.ts b/lib/utils/use-copy-to-clipboard.ts
index 77758114..c661d05f 100644
--- a/lib/utils/use-copy-to-clipboard.ts
+++ b/lib/utils/use-copy-to-clipboard.ts
@@ -12,7 +12,7 @@ export function useCopyToClipboard({
}: useCopyToClipboardProps) {
const [isCopied, setIsCopied] = React.useState<Boolean>(false);
- const copyToClipboard = (value: string, message: string) => {
+ const copyToClipboard = (value: string, message?: string) => {
if (typeof window === "undefined" || !navigator.clipboard?.writeText) {
return;
}
@@ -23,7 +23,7 @@ export function useCopyToClipboard({
navigator.clipboard.writeText(value).then(() => {
setIsCopied(true);
- toast.success(message);
+ message && toast.success(message);
setTimeout(() => {
setIsCopied(false);