Merge pull request from matrix-org/t3chguy/fix/15140

Don't count widgets which no longer exist towards pinned count
pull/21833/head
Michael Telatynski 2020-09-14 15:38:10 +01:00 committed by GitHub
commit e261a18183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
src/stores

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
const roomId = this.getRoomId(widgetId);
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) {