Don't count widgets which no longer exist towards pinned count

This commit is contained in:
Michael Telatynski 2020-09-14 14:03:51 +01:00
parent c68a980c59
commit 73608c4aa9

View file

@ -167,7 +167,9 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
// the only case it will go to three is if you have two and then a Jitsi gets added // the only case it will go to three is if you have two and then a Jitsi gets added
const roomId = this.getRoomId(widgetId); const roomId = this.getRoomId(widgetId);
const roomInfo = this.getRoom(roomId); const roomInfo = this.getRoom(roomId);
return roomInfo && Object.keys(roomInfo.pinned).length < 2; return roomInfo && Object.keys(roomInfo.pinned).filter(k => {
return roomInfo.widgets.some(app => app.id === k);
}).length < 2;
} }
public pinWidget(widgetId: string) { public pinWidget(widgetId: string) {