@robotical/webapp-types 3.22.0 → 3.22.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marty-web-app",
3
- "version": "3.22.0",
3
+ "version": "3.22.2",
4
4
  "private": true,
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "@radix-ui/react-dropdown-menu": "^2.1.2",
10
10
  "@radix-ui/react-icons": "^1.3.2",
11
- "@robdobsn/raftjs": "^2.2.0",
11
+ "@robdobsn/raftjs": "^2.4.1",
12
12
  "@robotical/appv2-analytics-gatherer": "^1.2.17",
13
13
  "@robotical/appv2-analytics-types": "^1.2.17",
14
14
  "@robotical/appv2-warranty-service-lib": "^1.2.19",
@@ -155,7 +155,7 @@ export default class ApplicationManager {
155
155
  * Start looking for rics to connect to
156
156
  * This is used from the Phone App only
157
157
  */
158
- startDiscovery(ricSelectedCb: (raft: RAFT) => void, uuids: string[]): Promise<void>;
158
+ startDiscovery(ricSelectedCb: (raft: RAFT) => void, uuids: string[], expectedRaftType?: ConnectableRaftType): Promise<void>;
159
159
  /**
160
160
  * Start discovery without verification
161
161
  * This is used from the Phone App only, when the user wants to connect to a RAFT with qr code
@@ -97,6 +97,14 @@ var getModalLogoForRaftType = function (raftType) {
97
97
  }
98
98
  return "none";
99
99
  };
100
+ var getDiscoveryRaftType = function (uuids) {
101
+ var includesMarty = uuids.includes(ConnManager.RICUUID);
102
+ var includesCog = uuids.includes(ConnManager.COGUUID);
103
+ if (includesMarty === includesCog) {
104
+ return undefined;
105
+ }
106
+ return includesCog ? RaftTypeE.COG : RaftTypeE.MARTY;
107
+ };
100
108
  var ApplicationManager = /** @class */ (function () {
101
109
  function ApplicationManager() {
102
110
  // locale
@@ -871,7 +879,7 @@ var ApplicationManager = /** @class */ (function () {
871
879
  return [2 /*return*/];
872
880
  }
873
881
  });
874
- }); }, uuids)];
882
+ }); }, uuids, expectedRaftType)];
875
883
  case 6:
876
884
  _a.sent();
877
885
  _a.label = 7;
@@ -1222,9 +1230,9 @@ var ApplicationManager = /** @class */ (function () {
1222
1230
  * Start looking for rics to connect to
1223
1231
  * This is used from the Phone App only
1224
1232
  */
1225
- ApplicationManager.prototype.startDiscovery = function (ricSelectedCb, uuids) {
1233
+ ApplicationManager.prototype.startDiscovery = function (ricSelectedCb, uuids, expectedRaftType) {
1226
1234
  return __awaiter(this, void 0, void 0, function () {
1227
- var wasDiscoveryStarted;
1235
+ var wasDiscoveryStarted, raftType, discoveryTarget;
1228
1236
  return __generator(this, function (_a) {
1229
1237
  switch (_a.label) {
1230
1238
  case 0:
@@ -1232,7 +1240,9 @@ var ApplicationManager = /** @class */ (function () {
1232
1240
  return [4 /*yield*/, window.wrapperCommunicator.sendMessageAndWait(AppSentMessage.RAFT_START_DISCOVERY, { uuids: uuids })];
1233
1241
  case 1:
1234
1242
  wasDiscoveryStarted = _a.sent();
1235
- return [4 /*yield*/, modalState.setModal(createElement(VerificationModalPhoneApp, { foundRICs: [] }), "Looking for RAFT")];
1243
+ raftType = expectedRaftType || getDiscoveryRaftType(uuids);
1244
+ discoveryTarget = raftType || "".concat(RaftTypeE.MARTY, " or ").concat(RaftTypeE.COG);
1245
+ return [4 /*yield*/, modalState.setModal(createElement(VerificationModalPhoneApp, { foundRICs: [] }), i18n.t("connection.looking_for_raft", { raftType: discoveryTarget }))];
1236
1246
  case 2:
1237
1247
  _a.sent();
1238
1248
  if (!wasDiscoveryStarted) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/webapp-types",
3
- "version": "3.22.0",
3
+ "version": "3.22.2",
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",