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

Commit

Permalink
Always allow users to edit their user widgets.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxl881 committed May 8, 2018
1 parent b532044 commit 8e1ba6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/views/elements/AppTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ export default class AppTile extends React.Component {
}

_canUserModify() {
// User widgets should always be modifiable by their creator
if (this.props.userWidget && MatrixClientPeg.get().credentials.userId === this.props.creatorUserId) {
return true;
}
// Check if the current user can modify widgets in the current room
return WidgetUtils.canUserModifyWidgets(this.props.room.roomId);
}

Expand Down Expand Up @@ -698,6 +703,8 @@ AppTile.propTypes = {
// Optional function to be called on widget capability request
// Called with an array of the requested capabilities
onCapabilityRequest: PropTypes.func,
// Is this an instance of a user widget
userWidget: PropTypes.bool,
};

AppTile.defaultProps = {
Expand All @@ -710,4 +717,5 @@ AppTile.defaultProps = {
showPopout: true,
handleMinimisePointerEvents: false,
whitelistCapabilities: [],
userWidget: false,
};
1 change: 1 addition & 0 deletions src/components/views/rooms/Stickerpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export default class Stickerpicker extends React.Component {
onMinimiseClick={this._onHideStickersClick}
handleMinimisePointerEvents={true}
whitelistCapabilities={['m.sticker']}
userWidget={true}
/>
</div>
</div>
Expand Down

0 comments on commit 8e1ba6d

Please sign in to comment.