diff --git a/packages/notion-client/src/notion-api.ts b/packages/notion-client/src/notion-api.ts index 2ed3c4259..e42bee9e9 100644 --- a/packages/notion-client/src/notion-api.ts +++ b/packages/notion-client/src/notion-api.ts @@ -237,17 +237,17 @@ export class NotionAPI { // console.log(block, source) if (source) { - if (!source.includes('secure.notion-static.com')) { - return [] + if (source.includes('secure.notion-static.com') || source.includes('prod-files-secure')) { + return { + permissionRecord: { + table: 'block', + id: block.id + }, + url: source + }; } - return { - permissionRecord: { - table: 'block', - id: block.id - }, - url: source - } + return [] } } diff --git a/packages/react-notion-x/src/third-party/pdf.tsx b/packages/react-notion-x/src/third-party/pdf.tsx index 90f5b6695..60c52a616 100644 --- a/packages/react-notion-x/src/third-party/pdf.tsx +++ b/packages/react-notion-x/src/third-party/pdf.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { Document, Page, pdfjs } from 'react-pdf' // ensure pdfjs can find its worker script regardless of how react-notion-x is bundled -pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js` +pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.mjs` export function Pdf({ file, ...rest }: { file: string }) { const [numPages, setNumPages] = React.useState(0)