mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Remove newPassword from share model, if disabled
It's important to delete the `newPassword` prop from the share model, if the user unchecks the isPasswordProtected checkbox. This clearer and allows for the unchecking to actually work as `this.$set()` fails with the falsy value `''`. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
parent
9c67ae4ec1
commit
8a67fc44c9
1 changed files with 7 additions and 3 deletions
|
|
@ -417,9 +417,13 @@ export default {
|
|||
|| !!this.share.password
|
||||
},
|
||||
async set(enabled) {
|
||||
// TODO: directly save after generation to make sure the share is always protected
|
||||
this.share.password = enabled ? await GeneratePassword() : ''
|
||||
this.$set(this.share, 'newPassword', this.share.password)
|
||||
if (enabled) {
|
||||
this.share.password = await GeneratePassword()
|
||||
this.$set(this.share, 'newPassword', this.share.password)
|
||||
} else {
|
||||
this.share.password = ''
|
||||
this.$delete(this.share, 'newPassword')
|
||||
}
|
||||
},
|
||||
},
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue