From e6f48c572273bdf02eb3563a7b1ce4903e214b34 Mon Sep 17 00:00:00 2001 From: Chris Hunt Date: Tue, 24 Oct 2023 12:14:18 +0100 Subject: [PATCH] Show disconnect button --- app/ui_screen.js | 7 +++++-- core/rfb.js | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/ui_screen.js b/app/ui_screen.js index 74afc8e4..0f8be126 100644 --- a/app/ui_screen.js +++ b/app/ui_screen.js @@ -95,13 +95,16 @@ const UI = { this._supportsBroadcastChannel = (typeof BroadcastChannel !== "undefined"); if (this._supportsBroadcastChannel) { this._controlChannel = new BroadcastChannel("registrationChannel"); - this._controlChannel.addEventListener('message', (event) => { + this._controlChannel.onmessage = (event) => { switch (event.data.eventType) { case 'identify': UI.identify(event.data) break; + case 'secondarydisconnected': + UI.updateVisualState('disconnected'); + break; } - }); + }; } diff --git a/core/rfb.js b/core/rfb.js index 6e28739b..2be01bca 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -1611,6 +1611,7 @@ export default class RFB extends EventTargetMixin { this._disconnTimer = setTimeout(() => { Log.Error("Disconnection timed out."); this._updateConnectionState('disconnected'); + this._proxyRFBMessage('secondarydisconnected') }, DISCONNECT_TIMEOUT * 1000); break;