Skip to content

Commit 73430c5

Browse files
committed
Correct check for enabled expiration date
The default expiration date cannot be enforced if it is not enabled in the first place. Hence, the check for whether a share has an expiration date should not consider enforcements but only where the share expiry type is enabled. For example : Using `this.config.isDefaultExpireDateEnabled` instead of `this.config.isDefaultExpireDateEnforced` which can be verified by checking `isExpiryDateEnforced`. Resolves : #40612 Signed-off-by: fenn-cs <fenn25.fn@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent fe9258a commit 73430c5

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,19 @@ export default {
368368
*/
369369
hasExpirationDate: {
370370
get() {
371+
const isDefaultExpireDateEnabled = this.config.isDefaultExpireDateEnabled
372+
const hasExistingExpirationDate = !!this.share.expireDate || isDefaultExpireDateEnabled
373+
const isDefaultInternalExpireDateEnabled = this.config.isDefaultInternalExpireDateEnabled
374+
const isDefaultRemoteExpireDateEnabled = this.config.isDefaultRemoteExpireDateEnabled
371375
if (this.isPublicShare) {
372-
return !!this.share.expireDate || this.config.isDefaultExpireDateEnforced
376+
return hasExistingExpirationDate
373377
}
378+
374379
if (this.isRemoteShare) {
375-
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
380+
return hasExistingExpirationDate || isDefaultRemoteExpireDateEnabled
376381
}
377-
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
382+
383+
return hasExistingExpirationDate || isDefaultInternalExpireDateEnabled
378384
},
379385
set(enabled) {
380386
this.share.expireDate = enabled

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)