dce-reactkit 3.4.0-beta.4 → 3.4.0-beta.5

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/cjs/index.js CHANGED
@@ -579,22 +579,17 @@ let storedSendRequest;
579
579
  * @returns sendRequest function
580
580
  */
581
581
  const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
582
- // Track timeout
583
- let timedOut = false;
582
+ // Show timeout error if too much time passes
583
+ let successful = false;
584
584
  (() => __awaiter(void 0, void 0, void 0, function* () {
585
585
  yield waitMs(5000);
586
- timedOut = true;
586
+ if (!successful) {
587
+ showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
588
+ }
587
589
  }))(),
588
590
  // Wait for initialization
589
591
  yield initialized;
590
- // Error if no send request function
591
- if (timedOut) {
592
- showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
593
- // Return dummy function that never resolves
594
- return (() => {
595
- return new Promise(() => { });
596
- });
597
- }
592
+ successful = true;
598
593
  // Return
599
594
  return storedSendRequest;
600
595
  });