@robotical/webapp-types 3.7.33 → 3.7.34

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.
@@ -397,55 +397,51 @@ var ApplicationManager = /** @class */ (function () {
397
397
  uuids = [ConnManager.COGUUID, ConnManager.RICUUID];
398
398
  }
399
399
  }
400
- if (!isPhoneApp()) return [3 /*break*/, 10];
400
+ if (!isPhoneApp()) return [3 /*break*/, 9];
401
401
  _a.label = 2;
402
402
  case 2:
403
- _a.trys.push([2, 8, , 9]);
404
- if (!isQRVerification) return [3 /*break*/, 5];
403
+ _a.trys.push([2, 7, , 8]);
404
+ if (!isQRVerification) return [3 /*break*/, 4];
405
405
  secondaryModalState.setModal(createElement(ConnectingLoadingSpinnerModal, {}), "Connecting...", false);
406
406
  this.ricSelectedCb = null;
407
407
  return [4 /*yield*/, window.applicationManager.startDiscoveryWithoutVerification(uuids, afterRaftConnectedCb)];
408
408
  case 3:
409
409
  _a.sent();
410
- return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 1000); })];
411
- case 4:
412
- _a.sent(); // make sure the device has shown up in the connection area
413
- secondaryModalState.closeModal();
414
- return [3 /*break*/, 7];
415
- case 5: return [4 /*yield*/, window.applicationManager.startDiscovery(function (newRaft) {
410
+ return [3 /*break*/, 6];
411
+ case 4: return [4 /*yield*/, window.applicationManager.startDiscovery(function (newRaft) {
416
412
  _this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, type: newRaft.type, name: newRaft.getFriendlyName() || "", isSelected: true });
417
413
  afterRaftConnectedCb(newRaft);
418
414
  }, uuids)];
419
- case 6:
415
+ case 5:
420
416
  _a.sent();
421
- _a.label = 7;
422
- case 7: return [3 /*break*/, 9];
423
- case 8:
417
+ _a.label = 6;
418
+ case 6: return [3 /*break*/, 8];
419
+ case 7:
424
420
  e_1 = _a.sent();
425
421
  Logger.error(SHOW_LOGS, TAG, "Failed to start discovery: ".concat(e_1));
426
- return [3 /*break*/, 9];
427
- case 9: return [3 /*break*/, 15];
428
- case 10:
422
+ return [3 /*break*/, 8];
423
+ case 8: return [3 /*break*/, 14];
424
+ case 9:
429
425
  secondaryModalState.setModal(createElement(ConnectingLoadingSpinnerModal, {}), "Connecting...", false);
430
- _a.label = 11;
431
- case 11:
432
- _a.trys.push([11, 13, , 14]);
426
+ _a.label = 10;
427
+ case 10:
428
+ _a.trys.push([10, 12, , 13]);
433
429
  return [4 /*yield*/, window.applicationManager.connectToRIC(RaftConnectionMethod.WEB_BLE, uuids, isQRVerification)];
434
- case 12:
430
+ case 11:
435
431
  newRaft = _a.sent();
436
432
  if (newRaft) {
437
433
  this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, type: newRaft.type, name: newRaft.getFriendlyName() || "", isSelected: true });
438
434
  afterRaftConnectedCb(newRaft);
439
435
  }
440
- return [3 /*break*/, 14];
441
- case 13:
436
+ return [3 /*break*/, 13];
437
+ case 12:
442
438
  e_2 = _a.sent();
443
439
  Logger.error(SHOW_LOGS, TAG, "Failed to connect to new robot: ".concat(e_2));
444
- return [3 /*break*/, 14];
445
- case 14:
440
+ return [3 /*break*/, 13];
441
+ case 13:
446
442
  secondaryModalState.closeModal();
447
- _a.label = 15;
448
- case 15: return [2 /*return*/];
443
+ _a.label = 14;
444
+ case 14: return [2 /*return*/];
449
445
  }
450
446
  });
451
447
  });
@@ -660,12 +656,21 @@ var ApplicationManager = /** @class */ (function () {
660
656
  */
661
657
  ApplicationManager.prototype.startDiscoveryWithoutVerification = function (uuids, afterRaftConnectedCb) {
662
658
  return __awaiter(this, void 0, void 0, function () {
663
- var foundRICs, wasDiscoveryStarted;
659
+ var foundRICs, notFoundTimeout, wasDiscoveryStarted;
664
660
  var _this = this;
665
661
  return __generator(this, function (_a) {
666
662
  switch (_a.label) {
667
663
  case 0:
668
664
  foundRICs = [];
665
+ notFoundTimeout = setTimeout(function () {
666
+ if (foundRICs.length === 0) {
667
+ _this.toaster.error("Make sure the robot is powered on and in range!");
668
+ }
669
+ window.applicationManager.stopDiscovery();
670
+ secondaryModalState.closeModal();
671
+ clearTimeout(notFoundTimeout);
672
+ }, 7000);
673
+ Logger.phoneAppLog(SHOW_LOGS, TAG, "before raftFoundSubscriptionHelper");
669
674
  raftFoundSubscriptionHelper().subscribe(function (_a) {
670
675
  var discoveredDevice = _a.discoveredDevice;
671
676
  return __awaiter(_this, void 0, void 0, function () {
@@ -683,6 +688,7 @@ var ApplicationManager = /** @class */ (function () {
683
688
  case 1:
684
689
  newRaft = _b.sent();
685
690
  if (!newRaft) return [3 /*break*/, 3];
691
+ secondaryModalState.closeModal();
686
692
  this.connectedRaftContextMethods.addConnectedRaft({ id: newRaft.id, type: newRaft.type, name: newRaft.getFriendlyName() || "", isSelected: true });
687
693
  afterRaftConnectedCb(newRaft);
688
694
  oldColours = newRaft._ledLcdColours;
@@ -101,6 +101,10 @@ export default function LEDLightsOrQRVerificationModal() {
101
101
  if (serialNoFromQR) {
102
102
  modalState.closeModalWithoutAnimation([ConnManager.generateServiceFilterUUID(serialNoFromQR)]);
103
103
  }
104
+ else {
105
+ // // testing
106
+ // modalState.closeModalWithoutAnimation([ConnManager.generateServiceFilterUUID('00000000000000000000000000000079')]);
107
+ }
104
108
  return [2 /*return*/];
105
109
  });
106
110
  }); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/webapp-types",
3
- "version": "3.7.33",
3
+ "version": "3.7.34",
4
4
  "description": "Type definitions for the Application Manager",
5
5
  "main": "dist/application-manager.d.ts",
6
6
  "types": "dist/application-manager.d.ts",