From edfef2df0b40d469ed5a18528c956677c89c9021 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 30 Sep 2020 17:09:45 +0100 Subject: [PATCH] Increase max pinned widgets to 3 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- 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 10327ce4e9..26e3f70b57 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -45,6 +45,8 @@ interface IRoomWidgets { pinned: Record; } +const MAX_PINNED = 3; + // TODO consolidate WidgetEchoStore into this // TODO consolidate ActiveWidgetStore into this export default class WidgetStore extends AsyncStoreWithClient { @@ -169,7 +171,7 @@ export default class WidgetStore extends AsyncStoreWithClient { const roomInfo = this.getRoom(roomId); return roomInfo && Object.keys(roomInfo.pinned).filter(k => { return roomInfo.widgets.some(app => app.id === k); - }).length < 2; + }).length < MAX_PINNED; } public pinWidget(widgetId: string) {