fix: set correct envelope item cache url (#2144)

This commit is contained in:
David Nguyen
2025-11-07 16:50:58 +11:00
committed by GitHub
parent 1650c55b19
commit 88371b665a
7 changed files with 52 additions and 28 deletions

View File

@ -12,7 +12,7 @@ import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
import 'react-pdf/dist/esm/Page/TextLayer.css';
import { PDF_VIEWER_PAGE_SELECTOR } from '@documenso/lib/constants/pdf-viewer';
import { getEnvelopeDownloadUrl } from '@documenso/lib/utils/envelope-download';
import { getEnvelopeItemPdfUrl } from '@documenso/lib/utils/envelope-download';
import { cn } from '../lib/utils';
import { useToast } from './use-toast';
@ -157,10 +157,10 @@ export const PDFViewer = ({
try {
setIsDocumentBytesLoading(true);
const documentUrl = getEnvelopeDownloadUrl({
const documentUrl = getEnvelopeItemPdfUrl({
type: 'view',
envelopeItem: envelopeItem,
token,
version,
});
const bytes = await fetch(documentUrl).then(async (res) => await res.arrayBuffer());