From ca0ad0b7ed4603d7b7b0d46c892343fda3856af7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 14 Sep 2020 14:03:51 +0100 Subject: [PATCH] Don't count widgets which no longer exist towards pinned count --- src/stores/WidgetStore.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index 377512223a..10327ce4e9 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -167,7 +167,9 @@ export default class WidgetStore extends AsyncStoreWithClient { // the only case it will go to three is if you have two and then a Jitsi gets added const roomId = this.getRoomId(widgetId); const roomInfo = this.getRoom(roomId); - return roomInfo && Object.keys(roomInfo.pinned).length < 2; + return roomInfo && Object.keys(roomInfo.pinned).filter(k => { + return roomInfo.widgets.some(app => app.id === k); + }).length < 2; } public pinWidget(widgetId: string) {