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