Skip to content

Commit

Permalink
fix: Delete link update code in ShareEntryLink
Browse files Browse the repository at this point in the history
Since Nexcloud27, all share edits can only be done from
the `SharingDetailsTab` or the `QuickShareSelect` so this concerned component
does not need to handle updates.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
  • Loading branch information
nfebe committed Dec 6, 2024
1 parent 87886da commit 6116a63
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,8 @@ export default {
* accordingly
*
* @param {Share} share the new share
* @param {boolean} [update] do we update the current share ?
*/
async pushNewLinkShare(share, update) {
async pushNewLinkShare(share) {
try {
// do nothing if we're already pending creation
if (this.loading) {
Expand Down Expand Up @@ -723,20 +722,13 @@ export default {
this.open = false
this.shareCreationComplete = true
console.debug('Link share created', newShare)
// if share already exists, copy link directly on next tick
let component
if (update) {
component = await new Promise(resolve => {
this.$emit('update:share', newShare, resolve)
})
} else {
// adding new share to the array and copying link to clipboard
// using promise so that we can copy link in the same click function
// and avoid firefox copy permissions issue
component = await new Promise(resolve => {
this.$emit('add:share', newShare, resolve)
})
}

// adding new share to the array and copying link to clipboard
// using promise so that we can copy link in the same click function
// and avoid firefox copy permissions issue
const component = await new Promise(resolve => {
this.$emit('add:share', newShare, resolve)
})

await this.getNode()
emit('files:node:updated', this.node)
Expand Down

0 comments on commit 6116a63

Please sign in to comment.