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/esm/index.js CHANGED
@@ -553,22 +553,17 @@ let storedSendRequest;
553
553
  * @returns sendRequest function
554
554
  */
555
555
  const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
556
- // Track timeout
557
- let timedOut = false;
556
+ // Show timeout error if too much time passes
557
+ let successful = false;
558
558
  (() => __awaiter(void 0, void 0, void 0, function* () {
559
559
  yield waitMs(5000);
560
- timedOut = true;
560
+ if (!successful) {
561
+ 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));
562
+ }
561
563
  }))(),
562
564
  // Wait for initialization
563
565
  yield initialized;
564
- // Error if no send request function
565
- if (timedOut) {
566
- 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));
567
- // Return dummy function that never resolves
568
- return (() => {
569
- return new Promise(() => { });
570
- });
571
- }
566
+ successful = true;
572
567
  // Return
573
568
  return storedSendRequest;
574
569
  });