organism-react-popup
Advanced tools
Comparing version 0.15.22 to 0.16.1
@@ -120,2 +120,4 @@ "use strict"; | ||
var prevAlerts = (0, _reshowHooks.usePrevious)(props.alerts); | ||
var _useState2 = (0, _react.useState)({}), | ||
@@ -129,5 +131,4 @@ dismissedAlerts = _useState2[0], | ||
(0, _react.useEffect)(function () { | ||
var nextAlertArr = []; | ||
(alerts || []).forEach(function (item, key) { | ||
if (prevAlerts !== props.alerts) { | ||
var nextAlertArr = (alerts || []).map(function (item) { | ||
var thisItem = "string" === typeof item ? { | ||
@@ -145,20 +146,20 @@ message: item | ||
nextAlertArr.push(thisItem); | ||
return thisItem; | ||
}); | ||
setAlertArr(nextAlertArr); | ||
}, [props]); | ||
} | ||
var handleDismiss = function handleDismiss(e) { | ||
var isContinue = (0, _callFunc["default"])(onDismiss, [e]); | ||
return (0, _react.useMemo)(function () { | ||
var handleDismiss = function handleDismiss(e) { | ||
var isContinue = (0, _callFunc["default"])(onDismiss, [e]); | ||
if (false !== isContinue) { | ||
// if no callback for dismissal, just update our state | ||
setDismissedAlerts(function (dismissedAlerts) { | ||
dismissedAlerts[e.data.id] = e.data; | ||
return (0, _objectSpread2["default"])({}, dismissedAlerts); | ||
}); | ||
} | ||
}; | ||
if (false !== isContinue) { | ||
// if no callback for dismissal, just update our state | ||
setDismissedAlerts(function (dismissedAlerts) { | ||
dismissedAlerts[e.data.id] = e.data; | ||
return (0, _objectSpread2["default"])({}, dismissedAlerts); | ||
}); | ||
} | ||
}; | ||
return (0, _react.useMemo)(function () { | ||
var positionStyle = {}; | ||
@@ -165,0 +166,0 @@ |
{ | ||
"version": "0.15.22", | ||
"version": "0.16.1", | ||
"name": "organism-react-popup", | ||
@@ -37,3 +37,2 @@ "repository": { | ||
"set-object-value": "*", | ||
"setimmediate": "*", | ||
"to-percent-js": "*", | ||
@@ -40,0 +39,0 @@ "win-doc": "*" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
227778
19
19
- Removedsetimmediate@*