Skip to content

Commit f0d78c1

Browse files
committed
fix: Fix clearing the new password
"newPassword" is internally delegated by the share object to "_share.newPassword" through getter and setter properties. Therefore deleting "newPassword" has no effect, as there is no such attribute, and it should be set to undefined instead. Now that "newPassword" is correctly cleared "Set password" is no longer checked if the share of a password is removed, the share is updated, and the share is customized again (without reloading the page in the meantime). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent d1e75c4 commit f0d78c1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/files_sharing/src/mixins/SharesMixin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export default {
327327
if (propertyNames.includes('password')) {
328328
// reset password state after sync
329329
this.share.password = this.share.newPassword || undefined
330-
this.$delete(this.share, 'newPassword')
330+
this.$set(this.share, 'newPassword', undefined)
331331

332332
// updates password expiration time after sync
333333
this.share.passwordExpirationTime = updatedShare.password_expiration_time
@@ -398,7 +398,7 @@ export default {
398398
if (this.share.newPassword === this.share.password) {
399399
this.share.password = ''
400400
}
401-
this.$delete(this.share, 'newPassword')
401+
this.$set(this.share, 'newPassword', undefined)
402402
}
403403

404404
// re-open menu if closed

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ export default {
12581258
*/
12591259
onPasswordChange(password) {
12601260
if (password === '') {
1261-
this.$delete(this.share, 'newPassword')
1261+
this.$set(this.share, 'newPassword', undefined)
12621262
this.passwordError = this.isNewShare && this.isPasswordEnforced
12631263
return
12641264
}

0 commit comments

Comments
 (0)