File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
dotcom-rendering/src/components Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ export const FetchMoreGalleriesData = ({
101101 . then ( ( fetchedData ) => {
102102 setData ( fetchedData ) ;
103103 setError ( undefined ) ;
104+ addDiscussionIds (
105+ fetchedData . trails
106+ . map ( ( trail ) => trail . discussion ?. discussionId )
107+ . filter ( isNonNullable ) ,
108+ ) ;
104109 } )
105110 . catch ( ( err ) => {
106111 setError (
@@ -110,15 +115,6 @@ export const FetchMoreGalleriesData = ({
110115 } ) ;
111116 } , [ ajaxUrl ] ) ;
112117
113- useEffect ( ( ) => {
114- if ( ! data ) return ;
115- addDiscussionIds (
116- data . trails
117- . map ( ( trail ) => trail . discussion ?. discussionId )
118- . filter ( isNonNullable ) ,
119- ) ;
120- } , [ data ] ) ;
121-
122118 if ( error ) {
123119 // Send the error to Sentry and then prevent the element from rendering
124120 window . guardian . modules . sentry . reportError ( error , 'more-galleries' ) ;
You can’t perform that action at this time.
0 commit comments