Skip to content

Commit 2fd960e

Browse files
committed
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 : #40396 Signed-off-by: fenn-cs <[email protected]>
1 parent d32e03d commit 2fd960e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

apps/files_sharing/src/views/SharingTab.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,16 @@ export default {
356356
* @param {Share} share the share to remove
357357
*/
358358
removeShare(share) {
359-
const index = this.shares.findIndex(item => item.id === share.id)
360-
// eslint-disable-next-line vue/no-mutating-props
361-
this.shares.splice(index, 1)
359+
// Get reference for this.linkShares or this.shares
360+
const shareList
361+
= share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL
362+
|| share.type === this.SHARE_TYPES.SHARE_TYPE_LINK
363+
? this.linkShares
364+
: this.shares
365+
const index = shareList.findIndex(item => item.id === share.id)
366+
if (index !== -1) {
367+
shareList.splice(index, 1)
368+
}
362369
},
363370
/**
364371
* Await for next tick and render after the list updated

0 commit comments

Comments
 (0)