@@ -231,39 +231,39 @@ const SectionWithData = ({ location: { state, pathname } }) => {
231
231
if ( state ) {
232
232
query = SECTION_BY_ID_QUERY
233
233
variables = { id : state . section . id }
234
- createProps = ( { data, loading } ) => ( {
234
+ createProps = ( { data } ) => ( {
235
235
section : {
236
236
...state . section ,
237
237
content : get ( data , 'section.content' ) ,
238
238
views : get ( data , 'section.views' ) ,
239
239
scrollY : get ( data , 'section.scrollY' )
240
240
} ,
241
241
chapter : state . chapter ,
242
- loading
242
+ loading : ! data . section
243
243
} )
244
244
} else if ( page . chapterTitle ) {
245
245
query = SECTION_BY_CHAPTER_TITLE_QUERY
246
246
variables = { title : page . chapterTitle }
247
- createProps = ( { data, loading } ) => ( {
247
+ createProps = ( { data } ) => ( {
248
248
section : get ( data , 'chapterByTitle.section' ) ,
249
249
chapter : {
250
250
...data . chapterByTitle ,
251
251
number : null
252
252
} ,
253
- loading
253
+ loading : ! data . chapterByTitle
254
254
} )
255
255
} else if ( page . chapterNumber ) {
256
256
query = SECTION_BY_NUMBER_QUERY
257
257
variables = page
258
- createProps = ( { data, loading } ) => ( {
258
+ createProps = ( { data } ) => ( {
259
259
section : get ( data , 'chapterByNumber.section' ) ,
260
260
chapter : data . chapterByNumber ,
261
- loading
261
+ loading : ! data . chapterByNumber
262
262
} )
263
263
}
264
264
265
265
return (
266
- < Query query = { query } variables = { variables } >
266
+ < Query query = { query } variables = { variables } fetchPolicy = "cache-and-network" >
267
267
{ queryInfo => (
268
268
< Mutation mutation = { VIEWED_SECTION_MUTATION } >
269
269
{ viewedSection => (
0 commit comments