Increase max pinned widgets to 3
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
23d95df30b
commit
edfef2df0b
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue