From 214a084d922b63fb85eb4f0f51730aa0391ee30d Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 15 Jan 2025 15:46:25 +0100 Subject: [PATCH] fix(files_sharing): Remove debounce from expiration date formatting This should be done as soon as changed, as the value is not passed to API but needs to be tracked internally (e.g. if you quickly press "save"). Signed-off-by: Ferdinand Thiessen --- apps/files_sharing/src/mixins/SharesMixin.js | 7 ++++--- apps/files_sharing/src/views/SharingDetailsTab.vue | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 55e31872da13e..ab84a6f0e19a3 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -128,7 +128,7 @@ export default { return this.config.isDefaultExpireDateEnforced } if (this.isRemoteShare) { - return this.config.isDefaultRemoteExpireDateEnforced + return this.config.isDefaultRemoteExpireDateEnforced } return this.config.isDefaultInternalExpireDateEnforced }, @@ -209,9 +209,10 @@ export default { * * @param {Date} date */ - onExpirationChange: debounce(function(date) { + onExpirationChange(date) { this.share.expireDate = this.formatDateToString(new Date(date)) - }, 500), + }, + /** * Uncheck expire date * We need this method because @update:checked diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index c65425f0e35ea..a50a3abf6bffc 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -144,7 +144,8 @@ :value="new Date(share.expireDate ?? dateTomorrow)" :min="dateTomorrow" :max="maxExpirationDateEnforced" - :hide-label="true" + hide-label + :label="t('files_sharing', 'Expiration date')" :placeholder="t('files_sharing', 'Expiration date')" type="date" @input="onExpirationChange" />