File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
projects/packages/videopress/src/client/block-editor/hooks/use-video-data Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ export default function useVideoData( {
100100 // Check if the video belongs to the current site.
101101 try {
102102 const doesBelong : { body : boolean } = await apiFetch ( {
103- path : `/wpcom/v2/videopress/${ guid } /check-ownership/${ response . post_id } ?_envelope ` ,
103+ path : `/wpcom/v2/videopress/${ guid } /check-ownership/${ response . post_id } ` ,
104104 method : 'GET' ,
105105 } ) ;
106106
107- setVideoBelongToSite ( ! ! doesBelong ?. body ) ;
107+ // Response shape can change depending on the envelope mode.
108+ setVideoBelongToSite (
109+ typeof doesBelong === 'boolean' ? doesBelong : ! ! doesBelong ?. body
110+ ) ;
108111 } catch ( error ) {
109112 debug ( 'Error checking if video belongs to site' , error ) ;
110113 }
You can’t perform that action at this time.
0 commit comments