@next-core/brick-kit 2.189.0 → 2.190.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.
package/dist/index.esm.js CHANGED
@@ -5850,9 +5850,10 @@ function startPoll(task, _ref, pollOptions, context) {
5850
5850
  if (!shouldStop) {
5851
5851
  var _computeRealValue2;
5852
5852
  var _result = yield task();
5853
+ var expectPollStopImmediatelyResult = (_computeRealValue2 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue2 === void 0 ? void 0 : _computeRealValue2();
5853
5854
  // Stop polling immediately when the expectation is match or a different router
5854
5855
  // is rendering after the task processed.
5855
- shouldStop = ((_computeRealValue2 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue2 === void 0 ? void 0 : _computeRealValue2()) || currentRenderId !== _internalApiGetRouterRenderId();
5856
+ shouldStop = expectPollStopImmediatelyResult || currentRenderId !== _internalApiGetRouterRenderId();
5856
5857
  if (!shouldStop) {
5857
5858
  var _computeRealValue3;
5858
5859
  progress === null || progress === void 0 ? void 0 : progress(_result);
@@ -5866,13 +5867,18 @@ function startPoll(task, _ref, pollOptions, context) {
5866
5867
  } else {
5867
5868
  delayedPoll(interval !== null && interval !== void 0 ? interval : 3000);
5868
5869
  }
5870
+ } else if (expectPollStopImmediatelyResult) {
5871
+ finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5869
5872
  }
5873
+ } else {
5874
+ finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5870
5875
  }
5871
5876
  } catch (e) {
5872
5877
  var _computeRealValue4;
5878
+ var _expectPollStopImmediatelyResult = (_computeRealValue4 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue4 === void 0 ? void 0 : _computeRealValue4();
5873
5879
  // Stop polling immediately when the expectation is match or a different router
5874
5880
  // is rendering after the task processed.
5875
- shouldStop = ((_computeRealValue4 = computeRealValue(expectPollStopImmediately, context)) === null || _computeRealValue4 === void 0 ? void 0 : _computeRealValue4()) || currentRenderId !== _internalApiGetRouterRenderId();
5881
+ shouldStop = _expectPollStopImmediatelyResult || currentRenderId !== _internalApiGetRouterRenderId();
5876
5882
  if (!shouldStop) {
5877
5883
  error === null || error === void 0 ? void 0 : error(e);
5878
5884
  if (continueOnError) {
@@ -5880,6 +5886,8 @@ function startPoll(task, _ref, pollOptions, context) {
5880
5886
  } else {
5881
5887
  finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5882
5888
  }
5889
+ } else if (_expectPollStopImmediatelyResult) {
5890
+ finallyCallback === null || finallyCallback === void 0 ? void 0 : finallyCallback();
5883
5891
  }
5884
5892
  } finally {
5885
5893
  // Manually dispatch an event of `request.end` when the polling is stopped immediately.