From 97c3f427298f7e364308666c3a7a1834765c4ff1 Mon Sep 17 00:00:00 2001 From: Chika Date: Mon, 28 Sep 2020 14:29:19 +0300 Subject: [PATCH] fix notification delay --- src/client/Elements/Notification.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/Elements/Notification.ts b/src/client/Elements/Notification.ts index e99b02a..3b11d3d 100644 --- a/src/client/Elements/Notification.ts +++ b/src/client/Elements/Notification.ts @@ -1,5 +1,6 @@ import { notification } from 'antd'; -import { throttle } from 'lodash'; +import { DEFAULT_DEBOUNCE_DELAY } from 'core/constants/debounce'; +import { debounce } from 'lodash'; type TNotification = 'success' | 'info' | 'warning' | 'error'; @@ -12,7 +13,7 @@ export const openNotification = ({ title: string; description: string; }) => - throttle( + debounce( () => notification[type]({ message: title, @@ -22,6 +23,5 @@ export const openNotification = ({ zIndex: 9999999999, }, }), - 3000, - { trailing: false }, + DEFAULT_DEBOUNCE_DELAY, );