aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-12-06 22:05:57 +0100
committerfenn-cs <fenn25.fn@gmail.com>2023-12-06 22:11:27 +0100
commite73a54906e4d0b1c0c8327275e601e12bdfe1f7f (patch)
tree6fd1122cd90e152e27d2a776811a08fa33ade0a1 /apps/files_sharing
parent06314a37c15ea90df47f295d8add6d1c3c8544cd (diff)
downloadnextcloud-server-e73a54906e4d0b1c0c8327275e601e12bdfe1f7f.tar.gz
nextcloud-server-e73a54906e4d0b1c0c8327275e601e12bdfe1f7f.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/files_sharing')
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue10
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')
+ }
},
},
/**