Skip to content

Commit

Permalink
Only clear share password model when actually saved
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
PVince81 authored and backportbot[bot] committed Mar 11, 2021
1 parent 1d0b210 commit 70af5aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 70af5aa

Please sign in to comment.