aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 3d6f5e6495f..baa098352d1 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -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,
+ })
}
},
},