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) {