diff --git a/src/components/views/context_menus/WidgetContextMenu.js b/src/components/views/context_menus/WidgetContextMenu.js index 9182b92c8c..6ed32daa5c 100644 --- a/src/components/views/context_menus/WidgetContextMenu.js +++ b/src/components/views/context_menus/WidgetContextMenu.js @@ -26,8 +26,8 @@ export default class WidgetContextMenu extends React.Component { // Callback for when the revoke button is clicked. Required. onRevokeClicked: PropTypes.func.isRequired, - // Callback for when the unpin button is clicked. Required. - onUnpinClicked: PropTypes.func.isRequired, + // Callback for when the unpin button is clicked. If absent, unpin will be hidden. + onUnpinClicked: PropTypes.func, // Callback for when the snapshot button is clicked. Button not shown // without a callback. @@ -86,11 +86,13 @@ export default class WidgetContextMenu extends React.Component { ); } - options.push( - - {_t("Unpin")} - , - ); + if (this.props.onUnpinClicked) { + options.push( + + {_t("Unpin")} + , + ); + } if (this.props.onReloadClicked) { options.push( diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index faca743bfd..02b2c22d4f 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -841,7 +841,7 @@ export default class AppTile extends React.Component { contextMenu = (