Skip to content

Commit

Permalink
fix: try fix image cache issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
fky2015 committed Feb 7, 2023
1 parent 7bef528 commit e02f433
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/notion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ const getNavigationLinkPages = pMemoize(
export async function getPage(pageId: string): Promise<ExtendedRecordMap> {
let recordMap = await notion.getPage(pageId)

if (recordMap && recordMap["signed_urls"]) {
const signed_urls = recordMap["signed_urls"]
const new_signed_urls = {}
for (const p in signed_urls) {
if (signed_urls[p] && signed_urls[p].includes(".amazonaws.com/")) {
console.log("skip : " + signed_urls[p])
continue
}
new_signed_urls[p] = signed_urls[p]
}
recordMap["signed_urls"] = new_signed_urls
}

if (navigationStyle !== 'default') {
// ensure that any pages linked to in the custom navigation header have
// their block info fully resolved in the page record map so we know
Expand All @@ -57,7 +70,7 @@ export async function getPage(pageId: string): Promise<ExtendedRecordMap> {

if (isPreviewImageSupportEnabled) {
const previewImageMap = await getPreviewImageMap(recordMap)
;(recordMap as any).preview_images = previewImageMap
; (recordMap as any).preview_images = previewImageMap
}

return recordMap
Expand Down

0 comments on commit e02f433

Please sign in to comment.