File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
react-notion-x/src/components Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ export const getPageImageUrls = (
23
23
if ( block ) {
24
24
if ( block . type === 'image' ) {
25
25
const signedUrl = recordMap . signed_urls ?. [ block . id ]
26
- const source = signedUrl || block . properties ?. source ?. [ 0 ] ?. [ 0 ]
26
+ let source = signedUrl || block . properties ?. source ?. [ 0 ] ?. [ 0 ]
27
+ if ( source . includes ( 'file.notion.so' ) ) {
28
+ source = block . properties ?. source ?. [ 0 ] ?. [ 0 ]
29
+ }
27
30
28
31
if ( source ) {
29
32
images . push ( {
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ export const Asset: React.FC<{
124
124
}
125
125
}
126
126
127
- const source =
127
+ let source =
128
128
recordMap . signed_urls ?. [ block . id ] || block . properties ?. source ?. [ 0 ] ?. [ 0 ]
129
129
let content = null
130
130
@@ -258,7 +258,10 @@ export const Asset: React.FC<{
258
258
}
259
259
} else if ( block . type === 'image' ) {
260
260
// console.log('image', block)
261
-
261
+ //kind of a hack for now. New file.notion.so images aren't signed correctly
262
+ if ( source . includes ( 'file.notion.so' ) ) {
263
+ source = block . properties ?. source ?. [ 0 ] ?. [ 0 ]
264
+ }
262
265
const src = mapImageUrl ( source , block as Block )
263
266
const caption = getTextContent ( block . properties ?. caption )
264
267
const alt = caption || 'notion image'
You can’t perform that action at this time.
0 commit comments