Skip to content

Commit 6003ff2

Browse files
committed
fix(status-bar): invalid status reported when stopping LocalStack externally
Fix status bar incorrectly reporting LocalStack as starting when stopping in certain scenarios
1 parent 1663aad commit 6003ff2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/localstack-status.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function createLocalStackStatusTracker(
3737
};
3838

3939
const deriveStatus = () => {
40-
const newStatus = getLocalStackStatus(containerStatus, healthCheck);
40+
const newStatus = getLocalStackStatus(containerStatus, healthCheck, status);
4141
setStatus(newStatus);
4242
};
4343

@@ -85,11 +85,15 @@ export async function createLocalStackStatusTracker(
8585
function getLocalStackStatus(
8686
containerStatus: ContainerStatus | undefined,
8787
healthCheck: boolean | undefined,
88+
previousStatus?: LocalStackStatus,
8889
): LocalStackStatus {
8990
if (containerStatus === "running") {
9091
if (healthCheck === true) {
9192
return "running";
9293
} else {
94+
if (previousStatus === "running" || previousStatus === "stopping") {
95+
return "stopping";
96+
}
9397
return "starting";
9498
}
9599
} else if (containerStatus === "stopping") {

0 commit comments

Comments
 (0)