@@ -140,20 +140,16 @@ const SectionCard = ({ sectionIdx }: SectionCardProps) => {
140140
141141
142142 useEffect ( ( ) => {
143- // if (appStateContext.state.failedSections.some((item) => item.title === sectionTitle) && isLoading) {
144143 if ( appStateContext . state ?. failedSections . length > 0 && appStateContext . state ?. failedSections [ 0 ] . title === sectionTitle && isLoading && ! appStateContext . state . isFailedReqInitiated ) {
145144 console . log ( "appStateContext.state?.failedSections" , appStateContext . state ?. failedSections ) ;
146145 const tempItem = {
147146 title : sectionTitle ,
148147 description : sectionDescription ,
149148 content : sectionContent
150149 }
151- //setTimeout(()=>{
152150 appStateContext ?. dispatch ( { type : 'REMOVED_FAILED_SECTION' , payload : { section : tempItem } } )
153151 appStateContext ?. dispatch ( { type : 'UPDATE_SECTION_API_REQ_STATUS' , payload : true } )
154- fetchSectionContent ( sectionTitle , sectionDescription , 'failed' ) ;
155- // },10000)
156-
152+ fetchSectionContent ( sectionTitle , sectionDescription , 'failed' ) ;
157153 }
158154 } , [ appStateContext . state . failedSections ] ) ;
159155
@@ -178,7 +174,6 @@ const SectionCard = ({ sectionIdx }: SectionCardProps) => {
178174 appStateContext ?. dispatch ( { type : 'UPDATE_SECTION_API_REQ_STATUS' , payload : false } )
179175
180176 setTimeout ( ( ) => {
181- // fetchSectionContent(sectionTitle,sectionDescription)
182177 } , 5000 )
183178
184179 } else {
@@ -198,8 +193,6 @@ const SectionCard = ({ sectionIdx }: SectionCardProps) => {
198193 setCharCount ( content . length )
199194 setIsLoading ( false )
200195
201- //appStateContext?.dispatch({ type: 'REMOVED_FAILED_SECTION', payload: updatedSection })
202-
203196 appStateContext ?. dispatch ( { type : 'REMOVED_FAILED_SECTION' , payload : { section : updatedSection } } )
204197
205198 if ( isReqFrom == 'failed' )
0 commit comments