You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-13 08:02:38 +03:00
Hide edit button when user does not have permission to edit.
This commit is contained in:
@@ -231,7 +231,7 @@ export default React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// editing is done in scalar
|
// editing is done in scalar
|
||||||
const showEditButton = Boolean(this._scalarClient);
|
const showEditButton = Boolean(this._scalarClient && this._canUserModify());
|
||||||
const deleteWidgetLabel = this._deleteWidgetLabel();
|
const deleteWidgetLabel = this._deleteWidgetLabel();
|
||||||
let deleteIcon = 'img/cancel.svg';
|
let deleteIcon = 'img/cancel.svg';
|
||||||
let deleteClasses = 'mx_filterFlipColor mx_AppTileMenuBarWidget';
|
let deleteClasses = 'mx_filterFlipColor mx_AppTileMenuBarWidget';
|
||||||
@@ -250,7 +250,9 @@ export default React.createClass({
|
|||||||
{showEditButton && <img
|
{showEditButton && <img
|
||||||
src="img/edit.svg"
|
src="img/edit.svg"
|
||||||
className="mx_filterFlipColor mx_AppTileMenuBarWidget mx_AppTileMenuBarWidgetPadding"
|
className="mx_filterFlipColor mx_AppTileMenuBarWidget mx_AppTileMenuBarWidgetPadding"
|
||||||
width="8" height="8" alt="Edit"
|
width="8" height="8"
|
||||||
|
alt={_t('Edit')}
|
||||||
|
title={_t('Edit')}
|
||||||
onClick={this._onEditClick}
|
onClick={this._onEditClick}
|
||||||
/>}
|
/>}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user