From 46b8cf4f64a8a2d9320ded762eeb0a4b9347181d Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 2 Jul 2021 17:42:55 +0200 Subject: Remove "Reject share" for pending remote shares In the list of pending shares, the option for rejecting the share has been removed. Signed-off-by: Vincent Petry --- apps/files/js/fileactions.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/files/js') diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index c7883e4d2a6..5d9e8578e19 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -155,6 +155,9 @@ if (_.isFunction(action.render)) { actionSpec.render = action.render; } + if (_.isFunction(action.shouldRender)) { + actionSpec.shouldRender = action.shouldRender; + } if (!this.actions[mime]) { this.actions[mime] = {}; } @@ -397,6 +400,11 @@ * @param {OCA.Files.FileActionContext} context rendering context */ _renderInlineAction: function(actionSpec, isDefault, context) { + if (actionSpec.shouldRender) { + if (!actionSpec.shouldRender(context)) { + return; + } + } var renderFunc = actionSpec.render || _.bind(this._defaultRenderAction, this); var $actionEl = renderFunc(actionSpec, isDefault, context); if (!$actionEl || !$actionEl.length) { -- cgit v1.2.3