Skip to content

Commit 765ca90

Browse files
Merge pull request #109 from zhelezkov/fix/command-on-status-change
call `onStatusChangeEmitter` on `status` change
2 parents 474261f + 0167af0 commit 765ca90

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/sessions/WebSocketSession/commands.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,18 @@ export class Command {
162162
/**
163163
* The status of the command.
164164
*/
165-
status: CommandStatus = "RUNNING";
165+
#status: CommandStatus = "RUNNING";
166+
167+
get status(): CommandStatus {
168+
return this.#status;
169+
}
170+
171+
set status(value: CommandStatus) {
172+
if (this.#status !== value) {
173+
this.#status = value;
174+
this.onStatusChangeEmitter.fire(this.#status);
175+
}
176+
}
166177

167178
/**
168179
* The command that was run

0 commit comments

Comments
 (0)