File tree Expand file tree Collapse file tree 2 files changed +2
-38
lines changed
Expand file tree Collapse file tree 2 files changed +2
-38
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import { useLocation } from 'react-router-dom'
1212
1313interface SectionCardProps {
1414 sectionIdx : number
15- // onLoadingChange: (isLoading: boolean) => void
1615}
1716
1817const useStyles = makeStyles ( {
@@ -157,7 +156,6 @@ const SectionCard = ({ sectionIdx }: SectionCardProps) => {
157156
158157 async function fetchSectionContent ( sectionTitle : string , sectionDescription : string , isReqFrom = '' ) {
159158 setIsLoading ( true )
160- //onLoadingChange(true)
161159
162160 const sectionGenerateRequest : SectionGenerateRequest = { sectionTitle, sectionDescription }
163161
@@ -193,7 +191,6 @@ const SectionCard = ({ sectionIdx }: SectionCardProps) => {
193191
194192 setCharCount ( content . length )
195193 setIsLoading ( false )
196- //onLoadingChange(false)
197194 appStateContext ?. dispatch ( { type : 'REMOVED_FAILED_SECTION' , payload : { section : updatedSection } } )
198195
199196 appStateContext ?. dispatch ( { type : 'UPDATE_IS_LOADED_SECTIONS' , payload : { section : updatedSection } } )
Original file line number Diff line number Diff line change @@ -28,10 +28,6 @@ const Draft = (): JSX.Element => {
2828 const [ isExportButtonDisable , setIsExportButtonDisable ] = useState < boolean > ( false )
2929
3030
31-
32- // redirect to home page if draftedDocument is empty
33-
34-
3531
3632 useEffect ( ( ) => {
3733
@@ -41,9 +37,7 @@ const Draft = (): JSX.Element => {
4137 } , index * 500 ) ;
4238 } ) ;
4339
44- return ( ) => {
45- appStateContext ?. dispatch ( { type : 'UPDATE_IS_LOADED_SECTIONS' , payload : { section : null , 'act' : 'removeAll' } } )
46- }
40+
4741 } , [ ] ) ;
4842
4943 useEffect ( ( ) => {
@@ -142,34 +136,7 @@ const Draft = (): JSX.Element => {
142136 return title . replace ( / [ ^ a - z A - Z 0 - 9 ] / g, '' )
143137 }
144138
145- // const handleLoadingChange = (isSectionLoading: boolean) => {
146- // setLoadingCount((prev) => {
147- // const newCount = isSectionLoading ? prev + 1 : prev - 1
148- // return newCount
149- // })
150- // }
151- // useEffect(() => {
152- // const failedSections = appStateContext?.state?.failedSections ?? []
153- // if (failedSections.length > 0) {
154-
155- // setTimeout(() => {
156- // setIsFailLoading(true);
157- // }, 5000);
158-
159- // if(failedSections.length>1)
160- // {
161- // setTimeout(() => {
162- // setLoadingCount(0)
163- // },5000);
164- // }
165- // }
166- // else
167- // {
168- // setTimeout(() => {
169- // setIsFailLoading(false)
170- // }, 5000);
171- // }
172- // }, [appStateContext?.state?.failedSections])
139+
173140
174141 return (
175142 < Stack className = { styles . container } >
You can’t perform that action at this time.
0 commit comments