diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2023-12-06 22:05:57 +0100 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2023-12-07 08:56:31 +0100 |
commit | 8a67fc44c9f6d06f21104861a26615719fbc42d0 (patch) | |
tree | 5eadb934fe99bdda95d1a89ce0ad62ec1a9755ab /apps | |
parent | 9c67ae4ec1279a9d07641267a7580b5e75e3cc53 (diff) | |
download | nextcloud-server-8a67fc44c9f6d06f21104861a26615719fbc42d0.tar.gz nextcloud-server-8a67fc44c9f6d06f21104861a26615719fbc42d0.zip |
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>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index a4a312fcc0e..d882aac9b87 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -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') + } }, }, /** |