@@ -66,13 +66,9 @@ export function ChatInterface() {
6666 if ( d . user ) setCurrentUser ( d . user . display_name || d . user . email ) ;
6767 } ) . catch ( ( ) => { } ) ;
6868
69- const controller = new AbortController ( ) ;
70- const loadTimeout = setTimeout ( ( ) => { controller . abort ( ) ; setInitialLoading ( false ) ; } , 10000 ) ;
71-
72- fetch ( "/api/chat/messages" , { signal : controller . signal } )
69+ fetch ( "/api/chat/messages" )
7370 . then ( ( r ) => r . json ( ) )
7471 . then ( ( data ) => {
75- clearTimeout ( loadTimeout ) ;
7672 if ( data . messages ?. length > 0 ) {
7773 console . info ( "[chat] Loaded" , data . messages . length , "messages, hasOlder:" , data . hasOlder ) ;
7874 const msgs = data . messages . map ( ( m : { id : number ; role : string ; content : string ; sender ?: string ; image_thumb ?: string } ) => ( {
@@ -102,7 +98,6 @@ export function ChatInterface() {
10298 }
10399 } )
104100 . catch ( ( ) => {
105- clearTimeout ( loadTimeout ) ;
106101 setMessages ( [ { id : "greeting" , role : "assistant" , content : t . chat . greeting } ] ) ;
107102 } )
108103 . finally ( ( ) => {
@@ -261,19 +256,13 @@ export function ChatInterface() {
261256 setChatImageType ( "" ) ;
262257 }
263258
264- const aiTimeout = setTimeout ( ( ) => {
265- console . warn ( "[chat] AI request timed out after 120s" ) ;
266- setLoading ( false ) ;
267- } , 120000 ) ;
268-
269259 fetch ( "/api/chat" , {
270260 method : "POST" ,
271261 headers : { "Content-Type" : "application/json" } ,
272262 body : JSON . stringify ( chatBody ) ,
273263 } )
274264 . then ( ( r ) => r . json ( ) )
275265 . then ( ( data ) => {
276- clearTimeout ( aiTimeout ) ;
277266 // Add from fetch response if SSE hasn't delivered it yet (dedup prevents doubles)
278267 if ( data . message ) {
279268 setMessages ( ( prev ) => {
@@ -285,7 +274,6 @@ export function ChatInterface() {
285274 }
286275 } )
287276 . catch ( ( ) => {
288- clearTimeout ( aiTimeout ) ;
289277 console . warn ( "[chat] AI request failed" ) ;
290278 setLoading ( false ) ;
291279 } ) ;
0 commit comments