diff options
author | Julius Härtl <jus@bitgrid.net> | 2024-08-30 15:33:03 +0200 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2024-08-30 17:33:39 +0000 |
commit | fe3926f0f05c2025e5cec0ab5c7246a8bf63fe3c (patch) | |
tree | c3e132307fa00361306335e36cefcf2427e2c6da /apps/files_sharing/src | |
parent | 7b05c3438586c5a1023bf6ac39ab3ee44db6f086 (diff) | |
download | nextcloud-server-fe3926f0f05c2025e5cec0ab5c7246a8bf63fe3c.tar.gz nextcloud-server-fe3926f0f05c2025e5cec0ab5c7246a8bf63fe3c.zip |
fix: Properly handle share attributes if set to null
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 13 |
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, + }) } }, }, |