@ndlib/component-library 1.0.10 → 1.0.12

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.
@@ -116,7 +116,7 @@ export const AlertsProvider = ({ domain = ALERT_DOMAIN.LIBRARY, endpoint, startT
116
116
  };
117
117
  const filteredAlerts = alerts
118
118
  .filter((alert) => !dismissedAlerts.includes(alert.uuid))
119
- .filter((alert) => alert.domains.includes(domain));
119
+ .filter((alert) => { var _a; return (_a = alert === null || alert === void 0 ? void 0 : alert.domains) === null || _a === void 0 ? void 0 : _a.includes(domain); });
120
120
  return (_jsx(AlertsContext.Provider, Object.assign({ value: {
121
121
  alerts: filteredAlerts,
122
122
  dismiss,
@@ -124,7 +124,7 @@ export const AlertsProvider = ({ domain = ALERT_DOMAIN.LIBRARY, endpoint, startT
124
124
  };
125
125
  export const useAlerts = (pageAlerts) => {
126
126
  const { alerts: allAlerts, dismiss } = React.useContext(AlertsContext);
127
- const alerts = pageAlerts
127
+ const alerts = pageAlerts && (pageAlerts === null || pageAlerts === void 0 ? void 0 : pageAlerts.length) > 0
128
128
  ? allAlerts.filter((alert) => alert.global || pageAlerts.includes(alert.uuid))
129
129
  : allAlerts.filter((alert) => alert.global);
130
130
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndlib/component-library",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -98,4 +98,4 @@
98
98
  "sanitize-html": "^2.12.1",
99
99
  "schema-dts": "^1.1.2"
100
100
  }
101
- }
101
+ }