diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-05-12 12:57:30 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-06-01 18:21:42 +0300 |
commit | 5d92a6a7c9a6541d2d6380d42c75bef6cab8c803 (patch) | |
tree | b0eb92be095921d31a25c29fa266a09f7fd77b2e /apps/files_sharing/src/mixins/SharesMixin.js | |
parent | 0f4de3d3533606e20ca4ff035f6eaf9c27bcac4a (diff) |
Fix the Talk verification
When enabling or disabling Talk verification in mail shares the server
expects also a new password to be set. As we always just update one
property at a time this means the Talk verification was impossible to
activate or deactivate. With this patch, we send the talk option AND the
new password. If there is no new password, the Talk option is disabled
(in mail shares; in link shares it is possible to enable or disable the
video verification without changing the password).
When we finally have descriptive text on ActionCheckbox'es we should
definitely add some explanatory text for the user. Right now this is as
good as it gets.
We'll have to backport to 18.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files_sharing/src/mixins/SharesMixin.js')
-rw-r--r-- | apps/files_sharing/src/mixins/SharesMixin.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index e19af48bc7e..72fec9e122b 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -224,31 +224,34 @@ export default { /** * Send an update of the share to the queue * - * @param {string} property the property to sync + * @param {string} propertyNames the properties to sync */ - queueUpdate(property) { + queueUpdate(...propertyNames) { + if (propertyNames.length === 0) { + // Nothing to update + return + } + if (this.share.id) { + const properties = {} // force value to string because that is what our // share api controller accepts - const value = this.share[property].toString() + propertyNames.map(p => (properties[p] = this.share[p].toString())) this.updateQueue.add(async() => { this.saving = true this.errors = {} try { - await this.updateShare(this.share.id, { - property, - value, - }) + await this.updateShare(this.share.id, properties) // clear any previous errors - this.$delete(this.errors, property) + this.$delete(this.errors, propertyNames[0]) // reset password state after sync this.$delete(this.share, 'newPassword') } catch ({ message }) { if (message && message !== '') { - this.onSyncError(property, message) + this.onSyncError(propertyNames[0], message) } } finally { this.saving = false |