@copart/ops-tool-kit 1.8.1-alpha.26 → 1.8.1-alpha.27

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.8.1-alpha.26";
36
+ const version$5 = "1.8.1-alpha.27";
37
37
  const main$1 = "dist/ops-tool-kit.js";
38
38
  const style = "dist/ops-tool-kit.css";
39
39
  const files = [
@@ -47933,33 +47933,41 @@ var AppBar = function AppBar(_ref) {
47933
47933
  });
47934
47934
  };
47935
47935
 
47936
+ var removeNotification = function removeNotification(newNotification) {
47937
+ setNotifications(function (notifications) {
47938
+ var currentNotifications = clone$1(notifications);
47939
+ var filteredNotifications = currentNotifications.filter(function (notification) {
47940
+ return notification.notificationId !== newNotification.notificationId;
47941
+ });
47942
+ return filteredNotifications;
47943
+ });
47944
+ setListOfAllNotifications(function (notifications) {
47945
+ var currentNotifications = clone$1(notifications);
47946
+ var filteredNotifications = currentNotifications.filter(function (notification) {
47947
+ return notification.notificationId !== newNotification.notificationId;
47948
+ });
47949
+ return filteredNotifications;
47950
+ });
47951
+ };
47952
+
47936
47953
  var updateAllNotificationsList = function updateAllNotificationsList(newNotifications) {
47937
47954
  if (newNotifications.length === 1) {
47955
+ var check = filterNotifications(newNotifications);
47956
+
47938
47957
  var newNotification = _objectSpread2({}, newNotifications[0]);
47939
47958
 
47940
47959
  var startTime = newNotification.timeZoneType === "RPTZ" ? newNotification.startsAt : moment.utc(newNotification.startsAt).local().format("YYYY-MM-DD HH:mm:ss");
47941
47960
  var endTime = newNotification.timeZoneType === "RPTZ" && newNotification.endDateTimeZone !== 'UTC' ? newNotification.endsAt : moment.utc(newNotification.endsAt).local().format("YYYY-MM-DD HH:mm:ss");
47942
47961
  var currentDate = new Date();
47943
47962
 
47944
- if (new Date(startTime) > currentDate && (newNotification === null || newNotification === void 0 ? void 0 : newNotification.status) === 'A') {
47963
+ if (!check.length) {
47964
+ removeNotification(newNotification);
47965
+ } else if (new Date(startTime) > currentDate && (newNotification === null || newNotification === void 0 ? void 0 : newNotification.status) === 'A') {
47945
47966
  setListOfAllNotifications(function (notifications) {
47946
47967
  return filterDuplicateAndSave(notifications, newNotifications);
47947
47968
  });
47948
47969
  } else if ((newNotification === null || newNotification === void 0 ? void 0 : newNotification.status) !== 'A' || !isOutOfRange(startTime, endTime)) {
47949
- setNotifications(function (notifications) {
47950
- var currentNotifications = clone$1(notifications);
47951
- var filteredNotifications = currentNotifications.filter(function (notification) {
47952
- return notification.notificationId !== newNotification.notificationId;
47953
- });
47954
- return filteredNotifications;
47955
- });
47956
- setListOfAllNotifications(function (notifications) {
47957
- var currentNotifications = clone$1(notifications);
47958
- var filteredNotifications = currentNotifications.filter(function (notification) {
47959
- return notification.notificationId !== newNotification.notificationId;
47960
- });
47961
- return filteredNotifications;
47962
- });
47970
+ removeNotification(newNotification);
47963
47971
  } else {
47964
47972
  setListOfAllNotifications(function (notifications) {
47965
47973
  return filterDuplicateAndSave(notifications, newNotifications);