Skip to content

Commit 301c555

Browse files
committed
Refactor stop command logic for improved proxy status handling. Closes #207
Closes #207
1 parent 46ca265 commit 301c555

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
> **Note**: odd version numbers, for example, `0.13.0`, are not included in this changelog. They are used to test the new features and fixes before the final release.
99
10+
## [0.19.0] - Unreleased
11+
12+
### Changed:
13+
14+
- Commands: Refactored stop command logic
15+
1016
## [0.18.3] - 2025-03-03
1117

1218
### Added:

src/commands.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,17 @@ export const registerCommands = (context: vscode.ExtensionContext, configuration
122122
}
123123
};
124124

125-
let isRunning = true;
126-
while (isRunning) {
127-
isRunning = await checkProxyStatus();
128-
if (isRunning) {
129-
await new Promise(resolve => setTimeout(resolve, 1000));
125+
const waitForProxyToStop = async () => {
126+
let isRunning = true;
127+
while (isRunning) {
128+
isRunning = await checkProxyStatus();
129+
if (isRunning) {
130+
await new Promise(resolve => setTimeout(resolve, 1000));
131+
}
130132
}
131-
}
133+
};
134+
135+
await waitForProxyToStop();
132136

133137
vscode.window.terminals.forEach(terminal => {
134138
if (terminal.name === 'Dev Proxy') {

0 commit comments

Comments
 (0)