summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-12-08 18:02:14 +0100
committerfenn-cs <fenn25.fn@gmail.com>2024-02-13 22:49:26 +0100
commit2806fc307ba1178222798642bde0249086fa6143 (patch)
treecc2445c3b6dcadb85a1059c9187f219f61d4bdf3
parent6dddd3e9780d65acc586d010929165e0742e8e07 (diff)
downloadnextcloud-server-2806fc307ba1178222798642bde0249086fa6143.tar.gz
nextcloud-server-2806fc307ba1178222798642bde0249086fa6143.zip
Allow user to finish typing date before formatting
Debounce `onExpirationChange` to avoid calling `formatDateToString` on invalid on uncompletely inputed date strings. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
-rw-r--r--apps/files_sharing/src/mixins/SharesMixin.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js
index 41bdf302f7a..b76b72cebe9 100644
--- a/apps/files_sharing/src/mixins/SharesMixin.js
+++ b/apps/files_sharing/src/mixins/SharesMixin.js
@@ -221,10 +221,9 @@ export default {
*
* @param {Date} date
*/
- onExpirationChange(date) {
+ onExpirationChange: debounce((date) => {
this.share.expireDate = this.formatDateToString(new Date(date))
- },
-
+ }, 500),
/**
* Uncheck expire date
* We need this method because @update:checked