fix notification delay
This commit is contained in:
parent
58ea7bba2d
commit
97c3f42729
@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user