Skip to content

Commit 1cfdff7

Browse files
nfebebackportbot[bot]
authored andcommitted
fix(files_sharing): Create download attribute when toggling checkbox if missing
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]
1 parent 08b4baf commit 1cfdff7

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,30 @@ export default {
736736
},
737737
738738
methods: {
739+
/**
740+
* Set a share attribute on the current share
741+
* @param {string} scope The attribute scope
742+
* @param {string} key The attribute key
743+
* @param {boolean} value The value
744+
*/
745+
setShareAttribute(scope, key, value) {
746+
if (!this.share.attributes) {
747+
this.$set(this.share, 'attributes', [])
748+
}
749+
750+
const attribute = this.share.attributes
751+
.find((attr) => attr.scope === scope || attr.key === key)
752+
753+
if (attribute) {
754+
attribute.value = value
755+
} else {
756+
this.share.attributes.push({
757+
scope,
758+
key,
759+
value,
760+
})
761+
}
762+
},
739763
updateAtomicPermissions({
740764
isReadChecked = this.hasRead,
741765
isEditChecked = this.canEdit,

0 commit comments

Comments
 (0)