diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-07-02 18:42:55 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-08-10 14:27:57 +0300 |
commit | 13781b0425391655daf94067a937d92103145a7d (patch) | |
tree | a93b80bf80816550925cd84620a5b820e7b1a644 /apps/files | |
parent | 08ab5d97dab170d642d98c0be20adf6757908315 (diff) |
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 <vincent@nextcloud.com>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/fileactions.js | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |