@plurid/plurid-ui-components-react 0.0.0-23 → 0.0.0-24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/distribution/index.es.js
CHANGED
|
@@ -3314,13 +3314,14 @@ const Notification$1 = properties => {
|
|
|
3314
3314
|
const [prepareForRemoval, setPrepareForRemoval] = useState(false);
|
|
3315
3315
|
const notificationTimeout = useRef(null);
|
|
3316
3316
|
useEffect((() => {
|
|
3317
|
-
|
|
3317
|
+
const timeoutValue = timeout === undefined ? react ? 4e3 : 2e3 + text.length * 40 : timeout === 0 ? undefined : timeout;
|
|
3318
|
+
if (timeoutValue) {
|
|
3318
3319
|
notificationTimeout.current = setTimeout((() => {
|
|
3319
3320
|
setPrepareForRemoval(true);
|
|
3320
3321
|
setTimeout((() => {
|
|
3321
3322
|
remove(id);
|
|
3322
3323
|
}), 400);
|
|
3323
|
-
}),
|
|
3324
|
+
}), timeoutValue);
|
|
3324
3325
|
}
|
|
3325
3326
|
return () => {
|
|
3326
3327
|
if (notificationTimeout.current) {
|