Merge pull request #52516 from nextcloud/fix/stable30/create-download-attribute-if-missing

[stable30] fix: Create `download` attribute when toggling checkbox
pull/52924/head
F. E Noel Nfebe 2025-05-16 14:30:18 +07:00 committed by GitHub
commit 5b1e9550e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 32 additions and 12 deletions

@ -430,11 +430,7 @@ export default {
return this.share.attributes.find(attr => attr.key === 'download')?.value || false
},
set(checked) {
// Find the 'download' attribute and update its value
const downloadAttr = this.share.attributes.find(attr => attr.key === 'download')
if (downloadAttr) {
downloadAttr.value = checked
}
this.setShareAttribute('permissions', 'download', checked)
},
},
/**
@ -744,6 +740,30 @@ export default {
},
methods: {
/**
* Set a share attribute on the current share
* @param {string} scope The attribute scope
* @param {string} key The attribute key
* @param {boolean} value The value
*/
setShareAttribute(scope, key, value) {
if (!this.share.attributes) {
this.$set(this.share, 'attributes', [])
}
const attribute = this.share.attributes
.find((attr) => attr.scope === scope || attr.key === key)
if (attribute) {
attribute.value = value
} else {
this.share.attributes.push({
scope,
key,
value,
})
}
},
updateAtomicPermissions({
isReadChecked = this.hasRead,
isEditChecked = this.canEdit,

2
dist/3821-3821.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
3821-3821.js.license

2
dist/7248-7248.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
7248-7248.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long