@copart/ops-tool-kit 1.10.0-alpha.20 → 1.10.0-alpha.21
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/dist/ops-tool-kit.js +22 -13
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -33,7 +33,7 @@ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
|
33
33
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
34
34
|
|
|
35
35
|
const name$f = "@copart/ops-tool-kit";
|
|
36
|
-
const version$5 = "1.10.0-alpha.
|
|
36
|
+
const version$5 = "1.10.0-alpha.21";
|
|
37
37
|
const main$1 = "dist/ops-tool-kit.js";
|
|
38
38
|
const style = "dist/ops-tool-kit.css";
|
|
39
39
|
const files = [
|
|
@@ -36986,10 +36986,10 @@ function filterOutNotificationByAudienceFirebase(notifications) {
|
|
|
36986
36986
|
|
|
36987
36987
|
function filterOutNotificationByAudience(notifications) {
|
|
36988
36988
|
var userEmail = storage$1.userEmail;
|
|
36989
|
-
var yardNumber = storage$1.activeYardNumber;
|
|
36990
|
-
|
|
36989
|
+
var yardNumber = storage$1.activeYardNumber; // const countryCodes = window.location.hostname.includes('.com') ? ["USA", "CAN"] : ["ARE", "OMN", "BHR", "IRL", "GBR"]
|
|
36990
|
+
|
|
36991
36991
|
return notifications.filter(function (notification) {
|
|
36992
|
-
if (!countryCodes.includes(notification.countryCode)) return false
|
|
36992
|
+
// if (!countryCodes.includes(notification.countryCode)) return false
|
|
36993
36993
|
var targets = pathOr$1([], ['targetAudience', 'targets'], notification);
|
|
36994
36994
|
if (!targets.length) return true;
|
|
36995
36995
|
return targets.some(function (target) {
|
|
@@ -42247,14 +42247,18 @@ var AppBar = function AppBar(_ref) {
|
|
|
42247
42247
|
});
|
|
42248
42248
|
});
|
|
42249
42249
|
filteredOutNotifications.forEach(function (notification) {
|
|
42250
|
-
|
|
42251
|
-
var startTime = moment.utc(notification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
|
|
42252
|
-
var currentDate = new Date();
|
|
42250
|
+
var _notification$newsTar;
|
|
42253
42251
|
|
|
42254
|
-
if (
|
|
42255
|
-
|
|
42256
|
-
|
|
42257
|
-
|
|
42252
|
+
if (notification === null || notification === void 0 ? void 0 : (_notification$newsTar = notification.newsTarget) === null || _notification$newsTar === void 0 ? void 0 : _notification$newsTar.audience_value) {
|
|
42253
|
+
removeNotification(notification);
|
|
42254
|
+
var startTime = moment.utc(notification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
|
|
42255
|
+
var currentDate = new Date();
|
|
42256
|
+
|
|
42257
|
+
if (new Date(startTime) > currentDate) {
|
|
42258
|
+
setListOfAllFirebaseNotifications(function (notifications) {
|
|
42259
|
+
return filterDuplicateAndSave(notifications, newNotifications);
|
|
42260
|
+
});
|
|
42261
|
+
}
|
|
42258
42262
|
}
|
|
42259
42263
|
});
|
|
42260
42264
|
}
|
|
@@ -42313,15 +42317,20 @@ var AppBar = function AppBar(_ref) {
|
|
|
42313
42317
|
};
|
|
42314
42318
|
|
|
42315
42319
|
var selectedYard = (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
|
|
42320
|
+
var socketRetryCount = 0;
|
|
42316
42321
|
|
|
42317
42322
|
var reConnectSocket = function reConnectSocket() {
|
|
42318
|
-
|
|
42319
|
-
|
|
42323
|
+
if (socketRetryCount < 15) {
|
|
42324
|
+
socketRetryCount = socketRetryCount + 1;
|
|
42325
|
+
socketClient && socketClient.close();
|
|
42326
|
+
setSocketClient(startWebSocketConnection(updateNotifications, updateAllNotificationsList, reConnectSocket));
|
|
42327
|
+
}
|
|
42320
42328
|
};
|
|
42321
42329
|
|
|
42322
42330
|
var handleVisibilityChange = function handleVisibilityChange() {
|
|
42323
42331
|
if (document.visibilityState === 'visible') {
|
|
42324
42332
|
if (socketClient && socketClient.readyState !== WebSocket.OPEN) {
|
|
42333
|
+
socketRetryCount = 0;
|
|
42325
42334
|
reConnectSocket();
|
|
42326
42335
|
}
|
|
42327
42336
|
}
|