]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow user to finish typing date before formatting
authorfenn-cs <fenn25.fn@gmail.com>
Fri, 8 Dec 2023 17:02:14 +0000 (18:02 +0100)
committerfenn-cs <fenn25.fn@gmail.com>
Mon, 11 Dec 2023 20:06:31 +0000 (21:06 +0100)
Debounce `onExpirationChange` to avoid calling `formatDateToString`
on invalid on uncompletely inputed date strings.

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
apps/files_sharing/src/mixins/SharesMixin.js

index 41bdf302f7a8ccf49c352fe03bf71cc221e3404a..b76b72cebe9eee0348b6cd21209a02b83361a82d 100644 (file)
@@ -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