Merge pull request #47638 from nextcloud/fix/share-attributes-null

fix: Properly handle share attributes if set to null
This commit is contained in:
Julius Härtl 2024-08-30 19:55:37 +02:00 committed by GitHub
commit 7362ede426
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 18 additions and 9 deletions

View file

@ -423,13 +423,22 @@ export default {
*/
canDownload: {
get() {
return this.share.attributes.find(attr => attr.key === 'download')?.value || false
return this.share.attributes?.find(attr => attr.key === 'download')?.value ?? true
},
set(checked) {
// Find the 'download' attribute and update its value
const downloadAttr = this.share.attributes.find(attr => attr.key === 'download')
const downloadAttr = this.share.attributes?.find(attr => attr.key === 'download')
if (downloadAttr) {
downloadAttr.value = checked
} else {
if (this.share.attributes === null) {
this.$set(this.share, 'attributes', [])
}
this.share.attributes.push({
scope: 'permissions',
key: 'download',
value: checked,
})
}
},
},

File diff suppressed because one or more lines are too long

View file

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

File diff suppressed because one or more lines are too long

1
dist/8215-8215.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/8215-8215.js.map.license vendored Symbolic link
View file

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long