Merge pull request #5283 from matrix-org/t3chguy/fix/w1

Fix naive pinning limit and app tile widgetMessaging NPE
This commit is contained in:
Michael Telatynski 2020-10-06 14:57:46 +01:00 committed by GitHub
commit 6f5f66e255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -563,8 +563,8 @@ export default class AppTile extends React.Component {
const canUserModify = this._canUserModify();
const showEditButton = Boolean(this._sgWidget.isManagedByManager && canUserModify);
const showDeleteButton = (this.props.showDelete === undefined || this.props.showDelete) && canUserModify;
const showPictureSnapshotButton = this._sgWidget.widgetApi.hasCapability(MatrixCapabilities.Screenshots)
&& this.props.show;
const showPictureSnapshotButton = this.props.show && this._sgWidget.widgetApi &&
this._sgWidget.widgetApi.hasCapability(MatrixCapabilities.Screenshots);
const WidgetContextMenu = sdk.getComponent('views.context_menus.WidgetContextMenu');
contextMenu = (

View File

@ -171,7 +171,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
const roomId = this.getRoomId(widgetId);
const roomInfo = this.getRoom(roomId);
return roomInfo && Object.keys(roomInfo.pinned).filter(k => {
return roomInfo.widgets.some(app => app.id === k);
return roomInfo.pinned[k] && roomInfo.widgets.some(app => app.id === k);
}).length < 2;
}