|
3 | 3 | Button,
|
4 | 4 | StatusIndicator,
|
5 | 5 | SpaceBetween,
|
6 |
| - Spinner, |
7 | 6 | } from '@cloudscape-design/components';
|
8 | 7 | import '@cloudscape-design/global-styles/index.css';
|
9 | 8 | import { useState, useEffect } from 'react';
|
@@ -34,34 +33,13 @@ const Header = ({
|
34 | 33 | isStartingLoading = false,
|
35 | 34 | }: HeaderProps) => {
|
36 | 35 | const [isLoading, setIsLoading] = useState(false);
|
37 |
| - const [statusCheckTimeout, setStatusCheckTimeout] = useState<number>(0); |
38 | 36 | const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false);
|
39 | 37 | const [showStopDevToolsConfirmation, setShowStopDevToolsConfirmation] =
|
40 | 38 | useState(false);
|
41 | 39 |
|
42 | 40 | // Reset loading state when sandbox status changes
|
43 | 41 | useEffect(() => {
|
44 |
| - console.log( |
45 |
| - `[CLIENT] Header: sandboxStatus prop changed to ${sandboxStatus}`, |
46 |
| - ); |
47 |
| - |
48 |
| - // Always reset loading state when status changes, regardless of the new state |
49 |
| - console.log( |
50 |
| - `[CLIENT] Header: Resetting isLoading to false due to status change: ${sandboxStatus}`, |
51 |
| - ); |
52 | 42 | setIsLoading(false);
|
53 |
| - |
54 |
| - // If status is still unknown after a delay, increment the timeout counter |
55 |
| - // to show a more informative message |
56 |
| - if (sandboxStatus === 'unknown') { |
57 |
| - const timer = setTimeout(() => { |
58 |
| - setStatusCheckTimeout((prev) => prev + 1); |
59 |
| - }, 3000); |
60 |
| - return () => clearTimeout(timer); |
61 |
| - } else { |
62 |
| - // Reset timeout counter when we get a definitive status |
63 |
| - setStatusCheckTimeout(0); |
64 |
| - } |
65 | 43 | }, [sandboxStatus]);
|
66 | 44 |
|
67 | 45 | const handleStartSandbox = () => {
|
@@ -130,29 +108,11 @@ const Header = ({
|
130 | 108 | </StatusIndicator>
|
131 | 109 | );
|
132 | 110 | default:
|
133 |
| - // Show different messages based on how long we've been checking |
134 |
| - if (statusCheckTimeout === 0) { |
135 |
| - return ( |
136 |
| - <StatusIndicator type="pending"> |
137 |
| - Checking Sandbox Status |
138 |
| - </StatusIndicator> |
139 |
| - ); |
140 |
| - } else if (statusCheckTimeout === 1) { |
141 |
| - return ( |
142 |
| - <StatusIndicator type="pending"> |
143 |
| - Still checking status... |
144 |
| - </StatusIndicator> |
145 |
| - ); |
146 |
| - } else { |
147 |
| - return ( |
148 |
| - <SpaceBetween direction="horizontal" size="xs"> |
149 |
| - <Spinner size="normal" /> |
150 |
| - <StatusIndicator type="pending"> |
151 |
| - Status check taking longer than expected |
152 |
| - </StatusIndicator> |
153 |
| - </SpaceBetween> |
154 |
| - ); |
155 |
| - } |
| 111 | + return ( |
| 112 | + <StatusIndicator type="pending"> |
| 113 | + Waiting for status... |
| 114 | + </StatusIndicator> |
| 115 | + ); |
156 | 116 | }
|
157 | 117 | };
|
158 | 118 |
|
|
0 commit comments