fix notification delay

This commit is contained in:
Chika 2020-09-28 14:29:19 +03:00
parent 58ea7bba2d
commit 97c3f42729

View File

@ -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,
);