Skip to content

Commit 4985e0e

Browse files
Merge pull request #596 from worgho2/fix/private-url-signing
2 parents 3991343 + 29111e5 commit 4985e0e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/notion-client/src/notion-api.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,17 @@ export class NotionAPI {
237237
// console.log(block, source)
238238

239239
if (source) {
240-
if (!source.includes('secure.notion-static.com')) {
241-
return []
240+
if (source.includes('secure.notion-static.com') || source.includes('prod-files-secure')) {
241+
return {
242+
permissionRecord: {
243+
table: 'block',
244+
id: block.id
245+
},
246+
url: source
247+
};
242248
}
243249

244-
return {
245-
permissionRecord: {
246-
table: 'block',
247-
id: block.id
248-
},
249-
url: source
250-
}
250+
return []
251251
}
252252
}
253253

packages/react-notion-x/src/third-party/pdf.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react'
22
import { Document, Page, pdfjs } from 'react-pdf'
33

44
// ensure pdfjs can find its worker script regardless of how react-notion-x is bundled
5-
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js`
5+
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.mjs`
66

77
export function Pdf({ file, ...rest }: { file: string }) {
88
const [numPages, setNumPages] = React.useState<number>(0)

0 commit comments

Comments
 (0)