From 70af5aacb4213e7840fa04e117601267dbaa36c3 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 3 Mar 2021 11:32:29 +0100 Subject: [PATCH] Only clear share password model when actually saved Instead of always clearing the password in the share model, now only do it when it was actually saved. Fixes an issue where saving another field would clear the password too early and prevent it to be saved when the dropdown closed. Signed-off-by: Vincent Petry Signed-off-by: npmbuildbot-nextcloud[bot] --- apps/files_sharing/src/mixins/SharesMixin.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index aef543a5fc6d6..4349e10d641bc 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -248,11 +248,14 @@ export default { try { await this.updateShare(this.share.id, properties) + if (propertyNames.indexOf('password') >= 0) { + // reset password state after sync + this.$delete(this.share, 'newPassword') + } + // clear any previous errors this.$delete(this.errors, propertyNames[0]) - // reset password state after sync - this.$delete(this.share, 'newPassword') } catch ({ message }) { if (message && message !== '') { this.onSyncError(propertyNames[0], message)