File tree 3 files changed +12
-6
lines changed
packages/react-notion-x/src/components
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,9 @@ export function Asset({
135
135
}
136
136
137
137
if ( block . space_id ) {
138
- source = source . concat ( '&spaceId=' , block . space_id )
138
+ const url = new URL ( source )
139
+ url . searchParams . set ( 'spaceId' , block . space_id )
140
+ source = url . toString ( )
139
141
}
140
142
141
143
let content = null
Original file line number Diff line number Diff line change @@ -16,14 +16,16 @@ export function Audio({
16
16
let source =
17
17
recordMap . signed_urls [ block . id ] || block . properties ?. source ?. [ 0 ] ?. [ 0 ]
18
18
19
- if ( block . space_id ) {
20
- source = source ?. concat ( '&spaceId=' , block . space_id )
21
- }
22
-
23
19
if ( ! source ) {
24
20
return null
25
21
}
26
22
23
+ if ( block . space_id ) {
24
+ const url = new URL ( source )
25
+ url . searchParams . set ( 'spaceId' , block . space_id )
26
+ source = url . toString ( )
27
+ }
28
+
27
29
return (
28
30
< div className = { cs ( 'notion-audio' , className ) } >
29
31
< audio controls preload = 'none' src = { source } />
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ export function File({
23
23
}
24
24
25
25
if ( block . space_id ) {
26
- source = source . concat ( '&spaceId=' , block . space_id )
26
+ const url = new URL ( source )
27
+ url . searchParams . set ( 'spaceId' , block . space_id )
28
+ source = url . toString ( )
27
29
}
28
30
29
31
return (
You can’t perform that action at this time.
0 commit comments