@copart/ops-tool-kit 1.10.0-alpha.20 → 1.10.0-alpha.22

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.
@@ -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.20";
36
+ const version$5 = "1.10.0-alpha.22";
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
- var countryCodes = window.location.hostname.includes('.com') ? ["USA", "CAN"] : ["ARE", "OMN", "BHR", "IRL", "GBR"];
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) {
@@ -37264,7 +37264,8 @@ var Banner = function Banner(props) {
37264
37264
  sourceApplication = notification.sourceApplication,
37265
37265
  categoryDescription = notification.categoryDescription,
37266
37266
  feedUrl = notification.feedUrl,
37267
- notificationId = notification.notificationId;
37267
+ notificationId = notification.notificationId,
37268
+ link = notification.link;
37268
37269
  var contentBarRef = React__default["default"].useRef(null);
37269
37270
 
37270
37271
  var _React$useState = React__default["default"].useState(false),
@@ -37330,8 +37331,8 @@ var Banner = function Banner(props) {
37330
37331
  dangerouslySetInnerHTML: {
37331
37332
  __html: SanitizeNotificationContent(content)
37332
37333
  }
37333
- }), action && ActionComponent && React__default["default"].createElement("a", {
37334
- href: feedUrl,
37334
+ }), (feedUrl || link) && React__default["default"].createElement("a", {
37335
+ href: feedUrl || link,
37335
37336
  target: "_blank",
37336
37337
  className: "utilities_ops-announcements_Banner--feedUrl"
37337
37338
  }, React__default["default"].createElement(coreComponents.Icon, {
@@ -42247,14 +42248,18 @@ var AppBar = function AppBar(_ref) {
42247
42248
  });
42248
42249
  });
42249
42250
  filteredOutNotifications.forEach(function (notification) {
42250
- removeNotification(notification);
42251
- var startTime = moment.utc(notification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
42252
- var currentDate = new Date();
42251
+ var _notification$newsTar;
42253
42252
 
42254
- if (new Date(startTime) > currentDate) {
42255
- setListOfAllFirebaseNotifications(function (notifications) {
42256
- return filterDuplicateAndSave(notifications, newNotifications);
42257
- });
42253
+ if (notification === null || notification === void 0 ? void 0 : (_notification$newsTar = notification.newsTarget) === null || _notification$newsTar === void 0 ? void 0 : _notification$newsTar.audience_value) {
42254
+ removeNotification(notification);
42255
+ var startTime = moment.utc(notification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
42256
+ var currentDate = new Date();
42257
+
42258
+ if (new Date(startTime) > currentDate) {
42259
+ setListOfAllFirebaseNotifications(function (notifications) {
42260
+ return filterDuplicateAndSave(notifications, newNotifications);
42261
+ });
42262
+ }
42258
42263
  }
42259
42264
  });
42260
42265
  }
@@ -42313,15 +42318,20 @@ var AppBar = function AppBar(_ref) {
42313
42318
  };
42314
42319
 
42315
42320
  var selectedYard = (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
42321
+ var socketRetryCount = 0;
42316
42322
 
42317
42323
  var reConnectSocket = function reConnectSocket() {
42318
- socketClient && socketClient.close();
42319
- setSocketClient(startWebSocketConnection(updateNotifications, updateAllNotificationsList, reConnectSocket));
42324
+ if (socketRetryCount < 15) {
42325
+ socketRetryCount = socketRetryCount + 1;
42326
+ socketClient && socketClient.close();
42327
+ setSocketClient(startWebSocketConnection(updateNotifications, updateAllNotificationsList, reConnectSocket));
42328
+ }
42320
42329
  };
42321
42330
 
42322
42331
  var handleVisibilityChange = function handleVisibilityChange() {
42323
42332
  if (document.visibilityState === 'visible') {
42324
42333
  if (socketClient && socketClient.readyState !== WebSocket.OPEN) {
42334
+ socketRetryCount = 0;
42325
42335
  reConnectSocket();
42326
42336
  }
42327
42337
  }