Increase max pinned widgets to 3

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-09-30 17:09:45 +01:00
parent 23d95df30b
commit edfef2df0b
1 changed files with 3 additions and 1 deletions

View File

@ -45,6 +45,8 @@ interface IRoomWidgets {
pinned: Record<string, boolean>;
}
const MAX_PINNED = 3;
// TODO consolidate WidgetEchoStore into this
// TODO consolidate ActiveWidgetStore into this
export default class WidgetStore extends AsyncStoreWithClient<IState> {
@ -169,7 +171,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
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) {