From 822f0e9f33b8711ac8a8b656a4778b7404a37e0b Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Sun, 7 Sep 2025 19:35:19 +0200
Subject: Remove timeouts that shouldn't be there

---
 src/frontend/app/components/StopSheet.tsx | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

(limited to 'src/frontend/app/components/StopSheet.tsx')

diff --git a/src/frontend/app/components/StopSheet.tsx b/src/frontend/app/components/StopSheet.tsx
index e8000d1..702c574 100644
--- a/src/frontend/app/components/StopSheet.tsx
+++ b/src/frontend/app/components/StopSheet.tsx
@@ -23,19 +23,16 @@ interface ErrorInfo {
 }
 
 const loadStopData = async (stopId: number): Promise<StopDetails> => {
-  // Add delay to see skeletons in action (remove in production)
-  await new Promise(resolve => setTimeout(resolve, 1000));
-  
   const resp = await fetch(`/api/GetStopEstimates?id=${stopId}`, {
     headers: {
       Accept: "application/json",
     },
   });
-  
+
   if (!resp.ok) {
     throw new Error(`HTTP ${resp.status}: ${resp.statusText}`);
   }
-  
+
   return await resp.json();
 };
 
@@ -55,17 +52,17 @@ export const StopSheet: React.FC<StopSheetProps> = ({
     if (!navigator.onLine) {
       return { type: 'network', message: 'No internet connection' };
     }
-    
+
     if (error.message?.includes('Failed to fetch') || error.message?.includes('NetworkError')) {
       return { type: 'network' };
     }
-    
+
     if (error.message?.includes('HTTP')) {
       const statusMatch = error.message.match(/HTTP (\d+):/);
       const status = statusMatch ? parseInt(statusMatch[1]) : undefined;
       return { type: 'server', status };
     }
-    
+
     return { type: 'unknown', message: error.message };
   };
 
@@ -74,7 +71,7 @@ export const StopSheet: React.FC<StopSheetProps> = ({
       setLoading(true);
       setError(null);
       setData(null);
-      
+
       const stopData = await loadStopData(stopId);
       setData(stopData);
       setLastUpdated(new Date());
@@ -138,8 +135,8 @@ export const StopSheet: React.FC<StopSheetProps> = ({
             {loading ? (
               <StopSheetSkeleton />
             ) : error ? (
-              <ErrorDisplay 
-                error={error} 
+              <ErrorDisplay
+                error={error}
                 onRetry={loadData}
                 title={t("errors.estimates_title", "Error al cargar estimaciones")}
                 className="compact"
@@ -193,9 +190,9 @@ export const StopSheet: React.FC<StopSheetProps> = ({
                       })}
                     </div>
                   )}
-                  
+
                   <div className="stop-sheet-actions">
-                    <button 
+                    <button
                       className="stop-sheet-reload"
                       onClick={loadData}
                       disabled={loading}
@@ -204,7 +201,7 @@ export const StopSheet: React.FC<StopSheetProps> = ({
                       <RefreshCw className={`reload-icon ${loading ? 'spinning' : ''}`} />
                       {t("estimates.reload", "Recargar")}
                     </button>
-                    
+
                     <Link
                       to={`/estimates/${stopId}`}
                       className="stop-sheet-view-all"
-- 
cgit v1.3

