summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-12-06 22:05:57 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2024-01-15 09:36:06 +0100
commit82dde3139fdd8af98d44d6d8eaa4c368ca9eadab (patch)
tree5ce5c7ef31cd271a135903f3ae83ca671f0d2738 /apps/files_sharing/src
parente5d8303decaac44355c4a9ec48ed356f15539a44 (diff)
downloadnextcloud-server-82dde3139fdd8af98d44d6d8eaa4c368ca9eadab.tar.gz
nextcloud-server-82dde3139fdd8af98d44d6d8eaa4c368ca9eadab.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/src')
-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 580d24eae58..67bfac3e74c 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -398,9 +398,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')
+ }
},
},
/**