@zac-apps/helium 1.0.2-beta.1 → 1.1.0

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/index.js +27 -28
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1572,7 +1572,7 @@ function Helium(props) {
1572
1572
 
1573
1573
  // State
1574
1574
 
1575
- var _useImmer = useImmer({}),
1575
+ var _useImmer = useImmer(null),
1576
1576
  _useImmer2 = _slicedToArray(_useImmer, 2),
1577
1577
  heliumData = _useImmer2[0],
1578
1578
  SetHeliumData = _useImmer2[1];
@@ -1584,10 +1584,10 @@ function Helium(props) {
1584
1584
  _useState4 = _slicedToArray(_useState3, 2),
1585
1585
  preprocessed = _useState4[0],
1586
1586
  SetPreprocessed = _useState4[1];
1587
- var _useState5 = useState({}),
1588
- _useState6 = _slicedToArray(_useState5, 2);
1589
- _useState6[0];
1590
- var SetHeliumError = _useState6[1];
1587
+ var _useState5 = useState(null),
1588
+ _useState6 = _slicedToArray(_useState5, 2),
1589
+ heliumError = _useState6[0],
1590
+ SetHeliumError = _useState6[1];
1591
1591
 
1592
1592
  // Query Media size for responsive column wrapping
1593
1593
 
@@ -1606,9 +1606,29 @@ function Helium(props) {
1606
1606
  SetState: SetHeliumData,
1607
1607
  SetError: SetHeliumError
1608
1608
  });
1609
+
1610
+ // Catch empty data
1611
+
1612
+ useEffect(function () {
1613
+ if (heliumError) {
1614
+ SetHeliumData(function (heliumData) {
1615
+ heliumData.helium = {};
1616
+ });
1617
+ Object.keys(heliumLookupData.lookup).map(function (spec) {
1618
+ SetHeliumData(function (heliumData) {
1619
+ heliumData.helium[spec] = 0;
1620
+ });
1621
+ });
1622
+ SetHeliumData(function (heliumData) {
1623
+ heliumData.meta = {};
1624
+ heliumData.meta.date = 0;
1625
+ });
1626
+ SetPreprocessed(true);
1627
+ }
1628
+ }, [heliumError]);
1609
1629
  useEffect(function () {
1610
- if (heliumData && heliumData.helium) {
1611
- Object.keys(heliumData.helium).map(function (spec) {
1630
+ if (heliumData !== null && heliumError === null) {
1631
+ Object.keys(heliumLookupData.lookup).map(function (spec) {
1612
1632
  SetHeliumData(function (heliumData) {
1613
1633
  heliumData.helium[spec] = Number(heliumData.helium[spec]);
1614
1634
  });
@@ -1616,27 +1636,6 @@ function Helium(props) {
1616
1636
  SetPreprocessed(true);
1617
1637
  }
1618
1638
  }, [heliumData]);
1619
-
1620
- // Catch empty data
1621
-
1622
- // useEffect(() => {
1623
- // if (heliumData) {
1624
- // SetHeliumData((heliumData) => {
1625
- // heliumData.helium = {};
1626
- // });
1627
- // Object.keys(heliumLookupData.lookup).map((spec) => {
1628
- // SetHeliumData((heliumData) => {
1629
- // heliumData.helium[spec] = 0;
1630
- // });
1631
- // });
1632
- // SetHeliumData((heliumData) => {
1633
- // heliumData.meta = {};
1634
- // heliumData.meta.date = 0;
1635
- // });
1636
- // SetPreprocessed(true);
1637
- // }
1638
- // }, [heliumError]);
1639
-
1640
1639
  if (!heliumData || !fetchGraph || !preprocessed) {
1641
1640
  return /*#__PURE__*/jsx(Progress, {});
1642
1641
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zac-apps/helium",
3
- "version": "1.0.2-beta.1",
3
+ "version": "1.1.0",
4
4
  "scripts": {
5
5
  "rollup": "node_modules/rollup/dist/rollup.js",
6
6
  "dev": "next dev",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@mui/icons-material": "^5.15.14",
32
32
  "@mui/material": "^5.15.14",
33
- "@zac-apps/commons": "^1.3.5-beta.2",
33
+ "@zac-apps/commons": "^1.3.6",
34
34
  "moment": "^2.30.1",
35
35
  "recharts": "^2.12.3",
36
36
  "use-immer": "^0.9.0"