Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6f5f66e

Browse files
authored
Merge pull request #5283 from matrix-org/t3chguy/fix/w1
Fix naive pinning limit and app tile widgetMessaging NPE
2 parents 5f615bd + 17a04f2 commit 6f5f66e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/views/elements/AppTile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ export default class AppTile extends React.Component {
563563
const canUserModify = this._canUserModify();
564564
const showEditButton = Boolean(this._sgWidget.isManagedByManager && canUserModify);
565565
const showDeleteButton = (this.props.showDelete === undefined || this.props.showDelete) && canUserModify;
566-
const showPictureSnapshotButton = this._sgWidget.widgetApi.hasCapability(MatrixCapabilities.Screenshots)
567-
&& this.props.show;
566+
const showPictureSnapshotButton = this.props.show && this._sgWidget.widgetApi &&
567+
this._sgWidget.widgetApi.hasCapability(MatrixCapabilities.Screenshots);
568568

569569
const WidgetContextMenu = sdk.getComponent('views.context_menus.WidgetContextMenu');
570570
contextMenu = (

src/stores/WidgetStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export default class WidgetStore extends AsyncStoreWithClient<IState> {
171171
const roomId = this.getRoomId(widgetId);
172172
const roomInfo = this.getRoom(roomId);
173173
return roomInfo && Object.keys(roomInfo.pinned).filter(k => {
174-
return roomInfo.widgets.some(app => app.id === k);
174+
return roomInfo.pinned[k] && roomInfo.widgets.some(app => app.id === k);
175175
}).length < 2;
176176
}
177177

0 commit comments

Comments
 (0)