summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-09-15 16:27:59 +0100
committernextcloud-command <nextcloud-command@users.noreply.github.com>2023-09-18 08:35:30 +0000
commit65ff60a69bd3b3318b920e504299f20911ea92d6 (patch)
tree075add49feb4ea45b9f913d462ecd01941f2decf /apps/files_sharing/src
parent4ff639eb51629cded66eeef2f4cf56a4c4a81984 (diff)
downloadnextcloud-server-65ff60a69bd3b3318b920e504299f20911ea92d6.tar.gz
nextcloud-server-65ff60a69bd3b3318b920e504299f20911ea92d6.zip
Consider link shares in removeShare method in SharingTab
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 : https://github.com/nextcloud/server/issues/40396 Signed-off-by: fenn-cs <fenn25.fn@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r--apps/files_sharing/src/views/SharingTab.vue13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue
index 0d5c1734548..f37f2095a90 100644
--- a/apps/files_sharing/src/views/SharingTab.vue
+++ b/apps/files_sharing/src/views/SharingTab.vue
@@ -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