Skip to content

Commit

Permalink
fix(files_sharing): Remove debounce from expiration date formatting
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
susnux committed Jan 15, 2025
1 parent 5106959 commit f5570a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down

0 comments on commit f5570a0

Please sign in to comment.