ordering-ui-react-native 0.22.80 → 0.22.82
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/package.json
CHANGED
|
@@ -168,11 +168,21 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
useEffect(() => {
|
|
171
|
-
events
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
if (!events?._events?.message_added_notification || events?._events?.message_added_notification?.length < 2) {
|
|
172
|
+
events.on('message_added_notification', (o: any) => handleEventNotification(1, o, orderStatus))
|
|
173
|
+
}
|
|
174
|
+
if (!events?._events?.order_added_notification || events?._events?.order_added_notification?.length < 2) {
|
|
175
|
+
events.on('order_added_notification', (o: any) => handleEventNotification(2, o, orderStatus))
|
|
176
|
+
}
|
|
177
|
+
if (!events?._events?.order_updated_notification || events?._events?.order_updated_notification?.length < 2) {
|
|
178
|
+
events.on('order_updated_notification', (o: any) => handleEventNotification(3, o, orderStatus))
|
|
179
|
+
}
|
|
180
|
+
if (!events?._events?.request_register_notification || events?._events?.request_register_notification?.length < 2) {
|
|
181
|
+
events.on('request_register_notification', (o: any) => handleEventNotification(2, o, orderStatus))
|
|
182
|
+
}
|
|
183
|
+
if (!events?._events?.request_update_notification || events?._events?.request_update_notification?.length < 2) {
|
|
184
|
+
events.on('request_update_notification', (o: any) => handleEventNotification(3, o, orderStatus))
|
|
185
|
+
}
|
|
176
186
|
|
|
177
187
|
return () => {
|
|
178
188
|
events.off('message_added_notification', (o: any) => handleEventNotification(1, o))
|
|
@@ -181,7 +191,7 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
181
191
|
events.off('request_register_notification', (o: any) => handleEventNotification(2, o))
|
|
182
192
|
events.off('request_update_notification', (o: any) => handleEventNotification(3, o))
|
|
183
193
|
}
|
|
184
|
-
}, [orderStatus])
|
|
194
|
+
}, [orderStatus, events])
|
|
185
195
|
|
|
186
196
|
useEffect(() => {
|
|
187
197
|
return () => setCurrentEvent(null)
|