aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornfebe <fenn25.fn@gmail.com>2025-04-29 00:29:01 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-05-16 12:30:41 +0000
commit1cfdff72f069c68b0a42a2aeed51d86ebb82779a (patch)
tree56192dbaffb1994cf1775e51d213df415cc73295
parent08b4baf5bedf5af9fe45ab3aae14bd658758128a (diff)
downloadnextcloud-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.vue24
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 f3d14b8b039..78292469ff5 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,