@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.js
CHANGED
|
@@ -3332,13 +3332,14 @@ const Notification$1 = properties => {
|
|
|
3332
3332
|
const [prepareForRemoval, setPrepareForRemoval] = React.useState(false);
|
|
3333
3333
|
const notificationTimeout = React.useRef(null);
|
|
3334
3334
|
React.useEffect((() => {
|
|
3335
|
-
|
|
3335
|
+
const timeoutValue = timeout === undefined ? react ? 4e3 : 2e3 + text.length * 40 : timeout === 0 ? undefined : timeout;
|
|
3336
|
+
if (timeoutValue) {
|
|
3336
3337
|
notificationTimeout.current = setTimeout((() => {
|
|
3337
3338
|
setPrepareForRemoval(true);
|
|
3338
3339
|
setTimeout((() => {
|
|
3339
3340
|
remove(id);
|
|
3340
3341
|
}), 400);
|
|
3341
|
-
}),
|
|
3342
|
+
}), timeoutValue);
|
|
3342
3343
|
}
|
|
3343
3344
|
return () => {
|
|
3344
3345
|
if (notificationTimeout.current) {
|