Skip to content

Commit

Permalink
Consider link shares in removeShare method in SharingTab
Browse files Browse the repository at this point in the history
Currently, the `removeShare` method in the `SharingTab` view,
does not take into account `linkShares`.

Since link shares now shares thesame detail view with other share types,
it should therefore be considered hence this commit.

Resolves : #40396

Signed-off-by: fenn-cs <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
nfebe authored and nextcloud-command committed Sep 15, 2023
1 parent d32e03d commit ef5bb42
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 13 deletions.
13 changes: 10 additions & 3 deletions apps/files_sharing/src/views/SharingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,16 @@ export default {
* @param {Share} share the share to remove
*/
removeShare(share) {
const index = this.shares.findIndex(item => item.id === share.id)
// eslint-disable-next-line vue/no-mutating-props
this.shares.splice(index, 1)
// Get reference for this.linkShares or this.shares
const shareList
= share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL
|| share.type === this.SHARE_TYPES.SHARE_TYPE_LINK
? this.linkShares
: this.shares
const index = shareList.findIndex(item => item.id === share.id)
if (index !== -1) {
shareList.splice(index, 1)
}
},
/**
* Await for next tick and render after the list updated
Expand Down
3 changes: 3 additions & 0 deletions dist/6898-6898.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/6898-6898.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/8087-8087.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/8087-8087.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit ef5bb42

Please sign in to comment.