From 65ff60a69bd3b3318b920e504299f20911ea92d6 Mon Sep 17 00:00:00 2001 From: fenn-cs Date: Fri, 15 Sep 2023 16:27:59 +0100 Subject: 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 Signed-off-by: nextcloud-command --- apps/files_sharing/src/views/SharingTab.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'apps/files_sharing/src') 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 -- cgit v1.2.3