@antv/dumi-theme-antv 0.3.7 → 0.3.8

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.
@@ -59,6 +59,8 @@ export var Toolbar = function Toolbar(_ref) {
59
59
  useEffect(function () {
60
60
  ping().then(function (status) {
61
61
  return updateRiddleVisible(status === 'responded');
62
+ }).catch(function () {
63
+ return updateRiddleVisible(false);
62
64
  });
63
65
  }, []);
64
66
  return /*#__PURE__*/React.createElement("div", {
@@ -14,7 +14,7 @@ export function ping() {
14
14
  }
15
15
  function _ping() {
16
16
  _ping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
17
- var timeout, network;
17
+ var timeout, url, network;
18
18
  return _regeneratorRuntime().wrap(function _callee$(_context) {
19
19
  while (1) switch (_context.prev = _context.next) {
20
20
  case 0:
@@ -23,14 +23,14 @@ function _ping() {
23
23
  resolve('timeout');
24
24
  }, 1500);
25
25
  });
26
- network = new Promise(function (resolve) {
27
- var url = 'https://private-a' + 'lipay' + 'objects.alip' + 'ay.com/alip' + 'ay-rmsdeploy-image/rmsportal/RKuAiriJqrUhyqW.png';
28
- fetch(url).then(function (resp) {
29
- return resolve(resp.status === 200 ? 'responded' : 'error');
30
- });
26
+ url = 'https://private-a' + 'lipay' + 'objects.alip' + 'ay.com/alip' + 'ay-rmsdeploy-image/rmsportal/RKuAiriJqrUhyqW.png';
27
+ network = fetch(url).then(function (resp) {
28
+ return resp.status === 200 ? 'responded' : 'error';
31
29
  });
32
- return _context.abrupt("return", Promise.race([timeout, network]));
33
- case 3:
30
+ return _context.abrupt("return", Promise.race([timeout, network]).catch(function (r) {
31
+ return 'error';
32
+ }));
33
+ case 4:
34
34
  case "end":
35
35
  return _context.stop();
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/dumi-theme-antv",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "AntV website theme based on dumi2.",
5
5
  "types": "dist/types.d.ts",
6
6
  "scripts": {