diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-05-01 14:42:01 +0200 |
---|---|---|
committer | npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com> | 2020-05-01 13:39:57 +0000 |
commit | 31172a0cd917716c6022edbfa580e19a6da50db8 (patch) | |
tree | 7858e4ab7fe31bc53fca6532d359af0b5ff6b741 /apps/files_sharing/src/components/SharingEntryLink.vue | |
parent | 91487d87395819a6fa052440bd582ae54abd41a0 (diff) | |
download | nextcloud-server-31172a0cd917716c6022edbfa580e19a6da50db8.tar.gz nextcloud-server-31172a0cd917716c6022edbfa580e19a6da50db8.zip |
Process shares only once, better debug and expiration date code
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntryLink.vue')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryLink.vue | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 5e15db16685..f8b8137cd29 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -398,15 +398,19 @@ export default { * @returns {boolean} */ hasExpirationDate: { - get: function() { - return this.config.isDefaultExpireDateEnforced || !!this.share.expireDate + get() { + return this.config.isDefaultExpireDateEnforced + || !!this.share.expireDate }, - set: function(enabled) { - this.share.expireDate = enabled - ? this.config.defaultExpirationDateString !== '' - ? this.config.defaultExpirationDateString - : moment().format('YYYY-MM-DD') + set(enabled) { + let dateString = moment(this.config.defaultExpirationDateString) + if (!dateString.isValid()) { + dateString = moment() + } + this.share.state.expiration = enabled + ? dateString.format('YYYY-MM-DD') : '' + console.debug('Expiration date status', enabled, this.share.expireDate) }, }, @@ -420,11 +424,11 @@ export default { * @returns {boolean} */ isPasswordProtected: { - get: function() { + get() { return this.config.enforcePasswordForPublicLink || !!this.share.password }, - set: async function(enabled) { + async set(enabled) { // TODO: directly save after generation to make sure the share is always protected Vue.set(this.share, 'password', enabled ? await this.generatePassword() : '') Vue.set(this.share, 'newPassword', this.share.password) |