mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: Properly handle share attributes if set to null
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
7b05c34385
commit
fe3926f0f0
1 changed files with 11 additions and 2 deletions
|
|
@ -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,
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue