diff options
Diffstat (limited to 'apps/files_sharing/src/views/SharingDetailsTab.vue')
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index fdb38da7f79..bb1ce9b0dea 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -373,19 +373,7 @@ export default { */ hasExpirationDate: { get() { - const isDefaultExpireDateEnabled = this.config.isDefaultExpireDateEnabled - const hasExistingExpirationDate = !!this.share.expireDate || isDefaultExpireDateEnabled - const isDefaultInternalExpireDateEnabled = this.config.isDefaultInternalExpireDateEnabled - const isDefaultRemoteExpireDateEnabled = this.config.isDefaultRemoteExpireDateEnabled - if (this.isPublicShare) { - return hasExistingExpirationDate - } - - if (this.isRemoteShare) { - return hasExistingExpirationDate || isDefaultRemoteExpireDateEnabled - } - - return hasExistingExpirationDate || isDefaultInternalExpireDateEnabled + return this.isValidShareAttribute(this.share.expireDate) }, set(enabled) { this.share.expireDate = enabled @@ -703,10 +691,19 @@ export default { this.share.newPassword = await GeneratePassword() this.advancedSectionAccordionExpanded = true } - if (this.hasExpirationDate) { - this.share.expireDate = this.defaultExpiryDate + /* Set default expiration dates if configured */ + if (this.isPublicShare && this.config.isDefaultExpireDateEnabled) { + this.share.expireDate = this.config.defaultExpirationDate.toDateString() + } else if (this.isRemoteShare && this.config.isDefaultRemoteExpireDateEnabled) { + this.share.expireDate = this.config.defaultRemoteExpirationDateString.toDateString() + } else if (this.config.isDefaultInternalExpireDateEnabled) { + this.share.expireDate = this.config.defaultInternalExpirationDate.toDateString() + } + + if (this.isValidShareAttribute(this.share.expireDate)) { this.advancedSectionAccordionExpanded = true } + return } |