Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: Properly handle share attributes if set to null
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and nextcloud-command committed Aug 30, 2024
commit fe3926f0f05c2025e5cec0ab5c7246a8bf63fe3c
13 changes: 11 additions & 2 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
},
},
Expand Down