Skip to content

Commit 05c34cd

Browse files
removed commented code
1 parent 9e43743 commit 05c34cd

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,4 +924,4 @@ def retrieve_document(filepath):
924924
raise e
925925

926926

927-
app = create_app()
927+
app = create_app()

frontend/src/api/api.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,6 @@ export const historyMessageFeedback = async (messageId: string, feedback: string
372372
}
373373

374374
export const sectionGenerate = async (options: SectionGenerateRequest): Promise<Response> => {
375-
// set timeout to 10 seconds
376-
// const abortController = new AbortController()
377-
// const abortSignal = abortController.signal
378-
379-
// const timeout = setTimeout(() => {
380-
// abortController.abort()
381-
// }, 30000)
382-
383375
let body = JSON.stringify({
384376
sectionTitle: options.sectionTitle,
385377
sectionDescription: options.sectionDescription
@@ -391,14 +383,11 @@ export const sectionGenerate = async (options: SectionGenerateRequest): Promise<
391383
'Content-Type': 'application/json'
392384
},
393385
body: body
394-
// signal: abortSignal
395386
})
396387
.then(res => {
397-
// clearTimeout(timeout)
398388
return res
399389
})
400390
.catch(_err => {
401-
// clearTimeout(timeout)
402391
console.error('There was an issue fetching your data.')
403392
return new Response(
404393
JSON.stringify({ section_content: 'There was an issue fetching your data. Please try again.' })

frontend/src/components/DraftCards/SectionCard.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)