Skip to content

Commit 49fc3f5

Browse files
Remove unnecessary Comments from Draft.tsx and SectionCards.tsx
1 parent 99348f0 commit 49fc3f5

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

src/frontend/src/components/DraftCards/SectionCard.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { useLocation } from 'react-router-dom'
1212

1313
interface SectionCardProps {
1414
sectionIdx: number
15-
// onLoadingChange: (isLoading: boolean) => void
1615
}
1716

1817
const 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} })

src/frontend/src/pages/draft/Draft.tsx

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff 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-zA-Z0-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}>

0 commit comments

Comments
 (0)