@ttoss/react-notifications 2.2.0 → 2.2.1

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.
Files changed (2) hide show
  1. package/dist/esm/index.js +12 -12
  2. package/package.json +4 -4
package/dist/esm/index.js CHANGED
@@ -126,21 +126,21 @@ var NotificationsProvider = props => {
126
126
  });
127
127
  });
128
128
  setNotifications((prevNotifications = []) => {
129
- const oldNotifications = prevNotifications.filter(prevNotification => {
130
- const newNotification = newNotifications.find(newNotification2 => {
131
- return newNotification2.id === prevNotification.id;
132
- });
133
- if (newNotification) {
134
- if (newNotification.viewType === "toast") {
135
- return false;
136
- }
137
- if (!newNotification.viewType && props.defaultViewType === "toast") {
138
- return false;
139
- }
129
+ const nonToastNewNotifications = newNotifications.filter(notification2 => {
130
+ if (notification2.viewType === "toast") {
131
+ return false;
132
+ }
133
+ if (!notification2.viewType && props.defaultViewType === "toast") {
134
+ return false;
140
135
  }
141
136
  return true;
142
137
  });
143
- return [...oldNotifications, ...newNotifications];
138
+ const oldNotifications = prevNotifications.filter(prevNotification => {
139
+ return !nonToastNewNotifications.some(newNotification => {
140
+ return newNotification.id === prevNotification.id;
141
+ });
142
+ });
143
+ return [...oldNotifications, ...nonToastNewNotifications];
144
144
  });
145
145
  }, [prefix, props.defaultViewType, removeNotification]);
146
146
  const clearNotifications = React.useCallback(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/react-notifications",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "ttoss notifications module for React apps.",
5
5
  "license": "MIT",
6
6
  "author": "ttoss",
@@ -26,8 +26,8 @@
26
26
  "peerDependencies": {
27
27
  "react": ">=16.8.0",
28
28
  "@ttoss/components": "^2.2.22",
29
- "@ttoss/react-icons": "^0.4.12",
30
- "@ttoss/ui": "^5.8.2"
29
+ "@ttoss/ui": "^5.8.2",
30
+ "@ttoss/react-icons": "^0.4.12"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/react": "^19.1.8",
@@ -35,9 +35,9 @@
35
35
  "react": "^19.1.0",
36
36
  "tsup": "^8.5.0",
37
37
  "@ttoss/components": "^2.2.22",
38
- "@ttoss/config": "^1.35.4",
39
38
  "@ttoss/react-icons": "^0.4.12",
40
39
  "@ttoss/test-utils": "^2.1.24",
40
+ "@ttoss/config": "^1.35.4",
41
41
  "@ttoss/ui": "^5.8.2"
42
42
  },
43
43
  "keywords": [