Increase max pinned widgets to 3
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
23d95df30b
commit
edfef2df0b
|
@ -45,6 +45,8 @@ interface IRoomWidgets {
|
||||||
pinned: Record<string, boolean>;
|
pinned: Record<string, boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MAX_PINNED = 3;
|
||||||
|
|
||||||
// TODO consolidate WidgetEchoStore into this
|
// TODO consolidate WidgetEchoStore into this
|
||||||
// TODO consolidate ActiveWidgetStore into this
|
// TODO consolidate ActiveWidgetStore into this
|
||||||
export default class WidgetStore extends AsyncStoreWithClient<IState> {
|
export default class WidgetStore extends AsyncStoreWithClient<IState> {
|
||||||
|
@ -169,7 +171,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
|
||||||
const roomInfo = this.getRoom(roomId);
|
const roomInfo = this.getRoom(roomId);
|
||||||
return roomInfo && Object.keys(roomInfo.pinned).filter(k => {
|
return roomInfo && Object.keys(roomInfo.pinned).filter(k => {
|
||||||
return roomInfo.widgets.some(app => app.id === k);
|
return roomInfo.widgets.some(app => app.id === k);
|
||||||
}).length < 2;
|
}).length < MAX_PINNED;
|
||||||
}
|
}
|
||||||
|
|
||||||
public pinWidget(widgetId: string) {
|
public pinWidget(widgetId: string) {
|
||||||
|
|
Loading…
Reference in New Issue