Skip to content

Commit e3c1c9b

Browse files
author
Megha Narayanan
committed
header minor fixes
1 parent 422058c commit e3c1c9b

File tree

1 file changed

+5
-45
lines changed
  • packages/cli/src/commands/sandbox/sandbox-devtools/react-app/src/components

1 file changed

+5
-45
lines changed

packages/cli/src/commands/sandbox/sandbox-devtools/react-app/src/components/Header.tsx

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
Button,
44
StatusIndicator,
55
SpaceBetween,
6-
Spinner,
76
} from '@cloudscape-design/components';
87
import '@cloudscape-design/global-styles/index.css';
98
import { useState, useEffect } from 'react';
@@ -34,34 +33,13 @@ const Header = ({
3433
isStartingLoading = false,
3534
}: HeaderProps) => {
3635
const [isLoading, setIsLoading] = useState(false);
37-
const [statusCheckTimeout, setStatusCheckTimeout] = useState<number>(0);
3836
const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false);
3937
const [showStopDevToolsConfirmation, setShowStopDevToolsConfirmation] =
4038
useState(false);
4139

4240
// Reset loading state when sandbox status changes
4341
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-
);
5242
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-
}
6543
}, [sandboxStatus]);
6644

6745
const handleStartSandbox = () => {
@@ -130,29 +108,11 @@ const Header = ({
130108
</StatusIndicator>
131109
);
132110
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+
);
156116
}
157117
};
158118

0 commit comments

Comments
 (0)