diff options
author | nfebe <fenn25.fn@gmail.com> | 2025-04-29 00:29:01 +0100 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2025-06-01 20:10:04 +0200 |
commit | bbfa4b031b7e1e972b3b06d41a92317aa496efd1 (patch) | |
tree | d4507d972f45d1b15b6d5134e39034d79661820d | |
parent | 4939be3572040619128e6a86b9a051c6c126f3d1 (diff) | |
download | nextcloud-server-backport/52516/stable29.tar.gz nextcloud-server-backport/52516/stable29.zip |
fix(files_sharing): Create `download` attribute when toggling checkbox if missingbackport/52516/stable29
Previously, toggling the checkbox did not create the 'download' attribute if it was missing,
causing it to become unresponsive after a page reload. Now, setShareAttribute ensures the
attribute is updated or created correctly.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
[skip ci]
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index 3290947b728..cf9745ee0d1 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -736,6 +736,30 @@ export default { }, methods: { + /** + * Set a share attribute on the current share + * @param {string} scope The attribute scope + * @param {string} key The attribute key + * @param {boolean} value The value + */ + setShareAttribute(scope, key, value) { + if (!this.share.attributes) { + this.$set(this.share, 'attributes', []) + } + + const attribute = this.share.attributes + .find((attr) => attr.scope === scope || attr.key === key) + + if (attribute) { + attribute.value = value + } else { + this.share.attributes.push({ + scope, + key, + value, + }) + } + }, updateAtomicPermissions({ isReadChecked = this.hasRead, isEditChecked = this.canEdit, |