diff --git a/src/link/sections.js b/src/link/sections.js index 7a82ee4..cd18f03 100644 --- a/src/link/sections.js +++ b/src/link/sections.js @@ -14,6 +14,7 @@ export const Sections = ( { const [ sections, setSections ] = useState( null ); const [ hoveredIndex, setHoverIndex ] = useState( -1 ); const [ selectedSection, setSelectedSection ] = useState( null ); + const [ loading, setLoading ] = useState( true ); const sectionsPrefix = 'wikipediapreview-edit-sections'; const isItemSelected = ( item ) => { @@ -62,6 +63,7 @@ export const Sections = ( { if ( ! sections && title && lang ) { wikipediaPreview.getSections( lang, title, ( info ) => { setSections( info.sections ); + setLoading( false ); } ); } }, [] ); @@ -91,7 +93,7 @@ export const Sections = ( { role="presentation" > - { sections && sections.length ? ( + { ! loading && sections && sections.length ? (