component-shipinlv 0.1.0 → 0.1.2
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import React, { useRef, useState } from 'react';
|
|
4
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import * as SubClientController from "../service/api/SubClientController";
|
|
6
6
|
import { useRequest } from '@umijs/hooks';
|
|
7
7
|
import "./index.less";
|
|
@@ -16,7 +16,9 @@ var TryRunStatusIntervalMillisecond = 1000;
|
|
|
16
16
|
var JoinClient = function JoinClient(_ref) {
|
|
17
17
|
var productType = _ref.productType,
|
|
18
18
|
_ref$port = _ref.port,
|
|
19
|
-
port = _ref$port === void 0 ? 0 : _ref$port
|
|
19
|
+
port = _ref$port === void 0 ? 0 : _ref$port,
|
|
20
|
+
_ref$onRunStatus = _ref.onRunStatus,
|
|
21
|
+
onRunStatus = _ref$onRunStatus === void 0 ? function () {} : _ref$onRunStatus;
|
|
20
22
|
var _useState = useState('loading'),
|
|
21
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
24
|
runStatus = _useState2[0],
|
|
@@ -25,6 +27,8 @@ var JoinClient = function JoinClient(_ref) {
|
|
|
25
27
|
var _useRequest = useRequest(function () {
|
|
26
28
|
return SubClientController.start({
|
|
27
29
|
productType: productType
|
|
30
|
+
}, {
|
|
31
|
+
silent: true
|
|
28
32
|
});
|
|
29
33
|
}, {
|
|
30
34
|
// manual: true,
|
|
@@ -190,6 +194,9 @@ var JoinClient = function JoinClient(_ref) {
|
|
|
190
194
|
children: runStatus
|
|
191
195
|
});
|
|
192
196
|
};
|
|
197
|
+
useEffect(function () {
|
|
198
|
+
onRunStatus(runStatus);
|
|
199
|
+
}, [runStatus]);
|
|
193
200
|
return /*#__PURE__*/_jsxs("div", {
|
|
194
201
|
className: "clientStatus",
|
|
195
202
|
children: [$status(), /*#__PURE__*/_jsx(Divider, {
|