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 <vincent@nextcloud.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
This commit is contained in:
Vincent Petry 2021-03-03 11:32:29 +01:00 committed by npmbuildbot-nextcloud[bot]
parent b306b88a41
commit 51ba0faeaf
3 changed files with 7 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -248,11 +248,14 @@ export default {
try { try {
await this.updateShare(this.share.id, properties) 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 // clear any previous errors
this.$delete(this.errors, propertyNames[0]) this.$delete(this.errors, propertyNames[0])
// reset password state after sync
this.$delete(this.share, 'newPassword')
} catch ({ message }) { } catch ({ message }) {
if (message && message !== '') { if (message && message !== '') {
this.onSyncError(propertyNames[0], message) this.onSyncError(propertyNames[0], message)