From 12e10ed8b91d4b8620576314b1b511c2351935ee Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 7 Jul 2024 01:06:19 +0200 Subject: [PATCH] fixed bug when maximized participant is leaving --- package.json | 2 +- ui/src/room-view.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index da4a4be..7afdd71 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "start": "AGENTS=1 npm run network", "network": "hc s clean && npm run build:happ && UI_PORT=8888 concurrently \"npm start -w ui\" \"npm run launch:happ\"", "test": "npm run build:zomes && hc app pack workdir --recursive && npm t -w tests", - "applet-dev": "concurrently \"UI_PORT=8888 npm run start -w ui\" \"we-dev-cli --agent-idx 1 --dev-config ./we.dev.config.ts\" \"sleep 10 && we-dev-cli --agent-idx 2 --dev-config ./we.dev.config.ts\"", + "applet-dev": "concurrently \"UI_PORT=8888 npm run start -w ui\" \"we-dev-cli --agent-idx 1 --dev-config ./we.dev.config.ts\" \"sleep 10 && we-dev-cli --agent-idx 2 --dev-config ./we.dev.config.ts --sync-time 20000\"", "applet-dev-3": "concurrently \"UI_PORT=8888 npm run start -w ui\" \"we-dev-cli --agent-idx 1 --dev-config ./we.dev.config.ts\" \"sleep 10 && we-dev-cli --agent-idx 2 --dev-config ./we.dev.config.ts\" \"sleep 10 && we-dev-cli --agent-idx 3 --dev-config ./we.dev.config.ts\"", "applet-dev-1": "concurrently \"UI_PORT=8888 npm run start -w ui\" \"we-dev-cli --agent-idx 1 --dev-config ./we.dev.config.ts\"", "help": "we-dev-cli --help", diff --git a/ui/src/room-view.ts b/ui/src/room-view.ts index 1c06f4f..5e4bd56 100644 --- a/ui/src/room-view.ts +++ b/ui/src/room-view.ts @@ -383,6 +383,10 @@ export class RoomView extends LitElement { peer.destroy(); const openConnections = this._openConnections; + const relevantConnection = openConnections[encodeHashToBase64(connectingAgent)]; + if (this._maximizedVideo === relevantConnection.connectionId) { + this._maximizedVideo = undefined; + } delete openConnections[encodeHashToBase64(connectingAgent)]; this._openConnections = openConnections; this.requestUpdate();