fix: clean up duplicate dialogs (#2686)

This commit is contained in:
David Nguyen
2026-04-09 14:37:49 +10:00
committed by GitHub
parent 283334921b
commit 6d7bd212bf
12 changed files with 159 additions and 612 deletions
@@ -9,6 +9,7 @@ import { FaXTwitter } from 'react-icons/fa6';
import { useCopyShareLink } from '@documenso/lib/client-only/hooks/use-copy-share-link';
import { NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app';
import { DO_NOT_INVALIDATE_QUERY_ON_MUTATION } from '@documenso/lib/constants/trpc';
import { generateTwitterIntent } from '@documenso/lib/universal/generate-twitter-intent';
import { trpc } from '@documenso/trpc/react';
@@ -60,7 +61,9 @@ export const DocumentShareButton = ({
mutateAsync: createOrGetShareLink,
data: shareLink,
isPending: isCreatingOrGettingShareLink,
} = trpc.document.share.useMutation();
} = trpc.document.share.useMutation({
...DO_NOT_INVALIDATE_QUERY_ON_MUTATION,
});
const isLoading = isCreatingOrGettingShareLink || isCopyingShareLink;
@@ -138,7 +141,7 @@ export const DocumentShareButton = ({
<DialogContent position="end">
<DialogHeader>
<DialogTitle>
<DialogTitle className="w-full max-w-full whitespace-pre-line break-words">
<Trans>Share your signing experience!</Trans>
</DialogTitle>
@@ -166,7 +169,7 @@ export const DocumentShareButton = ({
</span>
<div
className={cn(
'bg-muted/40 mt-4 aspect-[1200/630] overflow-hidden rounded-lg border',
'mt-4 aspect-[1200/630] overflow-hidden rounded-lg border bg-muted/40',
{
'animate-pulse': !shareLink?.slug,
},