ydb-components-material 0.1.144 → 0.1.145

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.
@@ -200,6 +200,7 @@ var FileItem = function FileItem(_ref) {
200
200
  var _useState18 = useState(0),
201
201
  signKey = _useState18[0],
202
202
  setSignKey = _useState18[1];
203
+ var timerRef = useRef(null);
203
204
  var originalUrlRef = useRef('');
204
205
  var getSignedFile = /*#__PURE__*/function () {
205
206
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(documentIdVal, contractIdVal, nameVal) {
@@ -218,12 +219,13 @@ var FileItem = function FileItem(_ref) {
218
219
  });
219
220
  case 1:
220
221
  newFile = _context.sent;
221
- sessionStorage.removeItem(tokenTY);
222
- localStorage.removeItem(tokenTY);
223
222
  if (!newFile) {
224
223
  _context.next = 2;
225
224
  break;
226
225
  }
226
+ clearInterval(timerRef.current);
227
+ sessionStorage.removeItem(tokenTY);
228
+ localStorage.removeItem(tokenTY);
227
229
  closeLoading();
228
230
  getRes(_extends({}, file, {
229
231
  fileId: newFile.fileId,
@@ -912,18 +914,21 @@ var FileItem = function FileItem(_ref) {
912
914
  originalUrl = _JSON$parse.fileUrl;
913
915
  console.log('docId', docId, contrId, nameVal);
914
916
  if (storedFileId !== fileId) return;
917
+ sessionStorage.removeItem(tokenTY);
915
918
  originalUrlRef.current = originalUrl || '';
916
919
  if (docId && contrId && nameVal) {
917
920
  openLoading();
918
- getSignedFile(docId, contrId, nameVal).then(function (success) {
919
- if (!success) {
920
- closeLoading();
921
- _Message.error('签署失败,请重新签署');
922
- }
923
- });
921
+ timerRef.current = setInterval(function () {
922
+ getSignedFile(docId, contrId, nameVal);
923
+ }, 3000);
924
924
  }
925
925
  }
926
926
  } catch (e) {}
927
+ return function () {
928
+ if (timerRef.current) {
929
+ clearInterval(timerRef.current);
930
+ }
931
+ };
927
932
  }, []);
928
933
  return /*#__PURE__*/React.createElement("div", {
929
934
  className: "file_item",
@@ -206,6 +206,7 @@ var FileItem = function FileItem(_ref) {
206
206
  var _useState18 = (0, _react.useState)(0),
207
207
  signKey = _useState18[0],
208
208
  setSignKey = _useState18[1];
209
+ var timerRef = (0, _react.useRef)(null);
209
210
  var originalUrlRef = (0, _react.useRef)('');
210
211
  var getSignedFile = /*#__PURE__*/function () {
211
212
  var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(documentIdVal, contractIdVal, nameVal) {
@@ -224,12 +225,13 @@ var FileItem = function FileItem(_ref) {
224
225
  });
225
226
  case 1:
226
227
  newFile = _context.sent;
227
- sessionStorage.removeItem(tokenTY);
228
- localStorage.removeItem(tokenTY);
229
228
  if (!newFile) {
230
229
  _context.next = 2;
231
230
  break;
232
231
  }
232
+ clearInterval(timerRef.current);
233
+ sessionStorage.removeItem(tokenTY);
234
+ localStorage.removeItem(tokenTY);
233
235
  closeLoading();
234
236
  getRes((0, _extends3["default"])({}, file, {
235
237
  fileId: newFile.fileId,
@@ -918,18 +920,21 @@ var FileItem = function FileItem(_ref) {
918
920
  originalUrl = _JSON$parse.fileUrl;
919
921
  console.log('docId', docId, contrId, nameVal);
920
922
  if (storedFileId !== fileId) return;
923
+ sessionStorage.removeItem(tokenTY);
921
924
  originalUrlRef.current = originalUrl || '';
922
925
  if (docId && contrId && nameVal) {
923
926
  openLoading();
924
- getSignedFile(docId, contrId, nameVal).then(function (success) {
925
- if (!success) {
926
- closeLoading();
927
- _message["default"].error('签署失败,请重新签署');
928
- }
929
- });
927
+ timerRef.current = setInterval(function () {
928
+ getSignedFile(docId, contrId, nameVal);
929
+ }, 3000);
930
930
  }
931
931
  }
932
932
  } catch (e) {}
933
+ return function () {
934
+ if (timerRef.current) {
935
+ clearInterval(timerRef.current);
936
+ }
937
+ };
933
938
  }, []);
934
939
  return /*#__PURE__*/_react["default"].createElement("div", {
935
940
  className: "file_item",
@@ -98,7 +98,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
98
98
  packageName = 'ydb-components-material';
99
99
  }
100
100
  if (version === void 0) {
101
- version = '0.1.144';
101
+ version = '0.1.145';
102
102
  }
103
103
  if (basicLibraryVersion === void 0) {
104
104
  basicLibraryVersion = {
@@ -103,7 +103,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
103
103
  packageName = 'ydb-components-material';
104
104
  }
105
105
  if (version === void 0) {
106
- version = '0.1.144';
106
+ version = '0.1.145';
107
107
  }
108
108
  if (basicLibraryVersion === void 0) {
109
109
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.144",
3
+ "version": "0.1.145",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -102,10 +102,10 @@
102
102
  },
103
103
  "componentConfig": {
104
104
  "isComponentLibrary": true,
105
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.144/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.145/build/lowcode/assets-prod.json"
106
106
  },
107
107
  "lcMeta": {
108
108
  "type": "component"
109
109
  },
110
- "homepage": "https://unpkg.com/ydb-components-material@0.1.144/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.145/build/index.html"
111
111
  }