From c5f115affaf3c3d4caba66364dd82fef0b8cb452 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Mon, 2 Oct 2023 14:32:27 +0200 Subject: [PATCH] fix(ui): fix control stop ev --- frontend/app/player/web/assist/RemoteControl.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/app/player/web/assist/RemoteControl.ts b/frontend/app/player/web/assist/RemoteControl.ts index 93131581a..f79acd764 100644 --- a/frontend/app/player/web/assist/RemoteControl.ts +++ b/frontend/app/player/web/assist/RemoteControl.ts @@ -43,7 +43,7 @@ export default class RemoteControl { socket.on('control_rejected', ({ meta, data }) => { if (data === socket.id) { this.toggleRemoteControl(false); - this.onEnd(); + if (this.store.get().remoteControl === RemoteControlStatus.Enabled) this.onEnd(); } this.onReject(); if (this.store.get().remoteControl === RemoteControlStatus.Requesting) { @@ -63,11 +63,9 @@ export default class RemoteControl { }); socket.on('disconnect', () => { this.toggleRemoteControl(false); - this.onEnd(); }); socket.on('error', () => { this.toggleRemoteControl(false); - this.onEnd(); }); this.assistVersion = getAssistVersion(); } @@ -96,7 +94,7 @@ export default class RemoteControl { onReject, onStart, onEnd, - onBusy, + onBusy, }: { onReject: () => void; onStart: () => void; @@ -106,6 +104,7 @@ export default class RemoteControl { this.onReject = onReject; this.onStart = onStart; this.onEnd = onEnd; + this.onBusy = onBusy; }; private onMouseClick = (e: MouseEvent): void => {