Skip to content

Commit 35f93e5

Browse files
committed
Fix restart from the UI
1 parent 7011a65 commit 35f93e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/debug-adapter/nativeScriptDebugAdapter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export class NativeScriptDebugAdapter extends ChromeDebugAdapter {
1111
private isLiveSync: boolean = false;
1212
private portWaitingResolve: any;
1313
private isDisconnecting: boolean = false;
14+
private isLiveSyncRestart: boolean = false;
1415

1516
public attach(args: any): Promise<void> {
1617
return this.processRequestAndAttach(args);
@@ -31,15 +32,15 @@ export class NativeScriptDebugAdapter extends ChromeDebugAdapter {
3132

3233
public disconnect(args: any): void {
3334
this.isDisconnecting = true;
34-
if (!args.restart) {
35+
if (!this.isLiveSyncRestart) {
3536
this.callRemoteMethod('buildService', 'disconnect');
3637
}
3738

3839
super.disconnect(args);
3940
}
4041

4142
protected async terminateSession(reason: string, disconnectArgs?: DebugProtocol.DisconnectArguments, restart?: IRestartRequestArgs): Promise<void> {
42-
let restartRequestArgs;
43+
let restartRequestArgs = restart;
4344
let timeoutId;
4445

4546
if (!this.isDisconnecting && this.isLiveSync) {
@@ -52,6 +53,7 @@ export class NativeScriptDebugAdapter extends ChromeDebugAdapter {
5253
});
5354

5455
restartRequestArgs = await portProm;
56+
this.isLiveSyncRestart = restartRequestArgs && !!restartRequestArgs.port;
5557
clearTimeout(timeoutId);
5658
}
5759

0 commit comments

Comments
 (0)