@robotical/webapp-types 3.11.6 → 3.11.8
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-types/src/application/RAFTs/Cog/PublishedDataAnalyser.js +1 -1
- package/dist-types/src/application/RAFTs/raft-subscription-helpers.d.ts +59 -88
- package/dist-types/src/application/RAFTs/raft-subscription-helpers.js +78 -77
- package/dist-types/src/components/modals/VerificationModal/index.js +2 -2
- package/dist-types/src/components/modals/VerificationModalPhoneApp/index.js +4 -2
- package/package.json +1 -1
|
@@ -118,7 +118,7 @@ var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
|
118
118
|
}
|
|
119
119
|
PublishedDataAnalyser.prototype.subscribeToPublishedData = function () {
|
|
120
120
|
var _this = this;
|
|
121
|
-
this.pubSub = createRaftPubSubscriptionHelper(this.cog);
|
|
121
|
+
this.pubSub = createRaftPubSubscriptionHelper(this.cog, this.cog.id);
|
|
122
122
|
this.pubSub.subscribe(function (data) {
|
|
123
123
|
_this.analyse(data.stateInfo);
|
|
124
124
|
});
|
|
@@ -1,89 +1,60 @@
|
|
|
1
1
|
import RAFT from "./RAFT";
|
|
2
|
-
|
|
3
|
-
subscribe: (callback: any) => void;
|
|
4
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export declare const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export declare const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export declare const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export declare const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
export declare const createRaftDiscoveryFinishedHelper: () => {
|
|
63
|
-
subscribe: (callback: any) => void;
|
|
64
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
65
|
-
};
|
|
66
|
-
export declare const raftDiscoveryStartedSubscriptionHelper: () => {
|
|
67
|
-
subscribe: (callback: any) => void;
|
|
68
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
69
|
-
};
|
|
70
|
-
export declare const createRaftDiscoveryStartedHelper: () => {
|
|
71
|
-
subscribe: (callback: any) => void;
|
|
72
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
73
|
-
};
|
|
74
|
-
export declare const raftRejectedSubscriptionHelper: (raft: RAFT) => {
|
|
75
|
-
subscribe: (callback: any) => void;
|
|
76
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
77
|
-
};
|
|
78
|
-
export declare const createRaftRejectedHelper: (raft: RAFT) => {
|
|
79
|
-
subscribe: (callback: any) => void;
|
|
80
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
81
|
-
};
|
|
82
|
-
export declare const raftPubSubscriptionHelper: (raft: RAFT) => {
|
|
83
|
-
subscribe: (callback: (eventData: any) => void) => void;
|
|
84
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
85
|
-
};
|
|
86
|
-
export declare const createRaftPubSubscriptionHelper: (raft: RAFT) => {
|
|
87
|
-
subscribe: (callback: (eventData: any) => void) => void;
|
|
88
|
-
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
89
|
-
};
|
|
2
|
+
type HelperReturnType = {
|
|
3
|
+
subscribe: (callback: any) => void;
|
|
4
|
+
unsubscribe: (shouldDestroyInstance?: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Connection Verifying Subscription Helper
|
|
8
|
+
*/
|
|
9
|
+
export declare const raftConnectingSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
10
|
+
export declare const createRaftConnectingHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
11
|
+
/**
|
|
12
|
+
* RAFT Connection issue detected Subscription Helper
|
|
13
|
+
*/
|
|
14
|
+
export declare const raftConnectionIssueDetectedSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
15
|
+
export declare const createRaftConnectionIssueDetectedHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
16
|
+
/**
|
|
17
|
+
* RAFT Connection Issue Resolved Subscription Helper
|
|
18
|
+
*/
|
|
19
|
+
export declare const raftConnectionIssueResolvedSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
20
|
+
export declare const createRaftConnectionIssueResolvedHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
21
|
+
/**
|
|
22
|
+
* RAFT Connected Subscription Helper
|
|
23
|
+
*/
|
|
24
|
+
export declare const raftConnectedSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
25
|
+
export declare const createRaftConnectedHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
26
|
+
/**
|
|
27
|
+
* RAFT Disconnected Subscription Helper
|
|
28
|
+
*/
|
|
29
|
+
export declare const raftDisconnectedSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
30
|
+
export declare const createRaftDisconnectedHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
31
|
+
/**
|
|
32
|
+
* RAFT Verified Subscription Helper
|
|
33
|
+
*/
|
|
34
|
+
export declare const raftVerifiedSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
35
|
+
export declare const createRaftVerifiedHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
36
|
+
/**
|
|
37
|
+
* Subscription Helper for raftFound event
|
|
38
|
+
* ApplicationManager
|
|
39
|
+
*/
|
|
40
|
+
export declare const raftFoundSubscriptionHelper: (helperId?: string) => HelperReturnType;
|
|
41
|
+
export declare const createRaftFoundHelper: (helperId: string) => HelperReturnType;
|
|
42
|
+
/**
|
|
43
|
+
* Subscription Helper for raftDiscoveryFinished event
|
|
44
|
+
*/
|
|
45
|
+
export declare const raftDiscoveryFinishedSubscriptionHelper: (helperId?: string) => HelperReturnType;
|
|
46
|
+
export declare const createRaftDiscoveryFinishedHelper: (helperId: string) => HelperReturnType;
|
|
47
|
+
/**
|
|
48
|
+
* Subscription Helper for raftDiscoveryStarted event
|
|
49
|
+
*/
|
|
50
|
+
export declare const raftDiscoveryStartedSubscriptionHelper: (helperId?: string) => HelperReturnType;
|
|
51
|
+
export declare const createRaftDiscoveryStartedHelper: (helperId: string) => HelperReturnType;
|
|
52
|
+
/**
|
|
53
|
+
* Subscription Helper for raftRejected event
|
|
54
|
+
* This event is triggered when the RAFT is rejected during the verification process
|
|
55
|
+
*/
|
|
56
|
+
export declare const raftRejectedSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
57
|
+
export declare const createRaftRejectedHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
58
|
+
export declare const raftPubSubscriptionHelper: (raft: RAFT, helperId?: string) => HelperReturnType;
|
|
59
|
+
export declare const createRaftPubSubscriptionHelper: (raft: RAFT, helperId: string) => HelperReturnType;
|
|
60
|
+
export {};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { RaftConnEvent } from "@robotical/raftjs";
|
|
2
|
+
var subHelpersObject = {};
|
|
2
3
|
/**
|
|
3
4
|
* Connection Verifying Subscription Helper
|
|
4
5
|
*/
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
if (!
|
|
8
|
-
|
|
6
|
+
export var raftConnectingSubscriptionHelper = function (raft, helperId) {
|
|
7
|
+
if (helperId === void 0) { helperId = 'raftConnectingSubscriptionHelper'; }
|
|
8
|
+
if (!subHelpersObject[helperId]) {
|
|
9
|
+
subHelpersObject[helperId] = createRaftConnectingHelper(raft, helperId);
|
|
9
10
|
}
|
|
10
|
-
return
|
|
11
|
+
return subHelpersObject[helperId];
|
|
11
12
|
};
|
|
12
|
-
export var createRaftConnectingHelper = function (raft) {
|
|
13
|
+
export var createRaftConnectingHelper = function (raft, helperId) {
|
|
13
14
|
var observer = null;
|
|
14
15
|
return {
|
|
15
16
|
subscribe: function (callback) {
|
|
@@ -22,7 +23,7 @@ export var createRaftConnectingHelper = function (raft) {
|
|
|
22
23
|
raft.unsubscribe(observer);
|
|
23
24
|
}
|
|
24
25
|
if (shouldDestroyInstance) {
|
|
25
|
-
|
|
26
|
+
subHelpersObject[helperId] = null;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
};
|
|
@@ -48,14 +49,14 @@ var raftConnectingSubscriptionObserver_ = function (callback) {
|
|
|
48
49
|
/**
|
|
49
50
|
* RAFT Connection issue detected Subscription Helper
|
|
50
51
|
*/
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
if (!
|
|
54
|
-
|
|
52
|
+
export var raftConnectionIssueDetectedSubscriptionHelper = function (raft, helperId) {
|
|
53
|
+
if (helperId === void 0) { helperId = 'raftConnectionIssueDetectedSubscriptionHelper'; }
|
|
54
|
+
if (!subHelpersObject[helperId]) {
|
|
55
|
+
subHelpersObject[helperId] = createRaftConnectionIssueDetectedHelper(raft, helperId);
|
|
55
56
|
}
|
|
56
|
-
return
|
|
57
|
+
return subHelpersObject[helperId];
|
|
57
58
|
};
|
|
58
|
-
export var createRaftConnectionIssueDetectedHelper = function (raft) {
|
|
59
|
+
export var createRaftConnectionIssueDetectedHelper = function (raft, helperId) {
|
|
59
60
|
var observer = null;
|
|
60
61
|
return {
|
|
61
62
|
subscribe: function (callback) {
|
|
@@ -68,7 +69,7 @@ export var createRaftConnectionIssueDetectedHelper = function (raft) {
|
|
|
68
69
|
raft.unsubscribe(observer);
|
|
69
70
|
}
|
|
70
71
|
if (shouldDestroyInstance) {
|
|
71
|
-
|
|
72
|
+
subHelpersObject[helperId] = null;
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
};
|
|
@@ -96,14 +97,14 @@ var raftConnectionIssueDetectedSubscriptionObserver_ = function (callback) {
|
|
|
96
97
|
/**
|
|
97
98
|
* RAFT Connection Issue Resolved Subscription Helper
|
|
98
99
|
*/
|
|
99
|
-
var
|
|
100
|
-
|
|
101
|
-
if (!
|
|
102
|
-
|
|
100
|
+
export var raftConnectionIssueResolvedSubscriptionHelper = function (raft, helperId) {
|
|
101
|
+
if (helperId === void 0) { helperId = 'raftConnectionIssueResolvedSubscriptionHelper'; }
|
|
102
|
+
if (!subHelpersObject[helperId]) {
|
|
103
|
+
subHelpersObject[helperId] = createRaftConnectionIssueResolvedHelper(raft, helperId);
|
|
103
104
|
}
|
|
104
|
-
return
|
|
105
|
+
return subHelpersObject[helperId];
|
|
105
106
|
};
|
|
106
|
-
export var createRaftConnectionIssueResolvedHelper = function (raft) {
|
|
107
|
+
export var createRaftConnectionIssueResolvedHelper = function (raft, helperId) {
|
|
107
108
|
var observer = null;
|
|
108
109
|
return {
|
|
109
110
|
subscribe: function (callback) {
|
|
@@ -116,7 +117,7 @@ export var createRaftConnectionIssueResolvedHelper = function (raft) {
|
|
|
116
117
|
raft.unsubscribe(observer);
|
|
117
118
|
}
|
|
118
119
|
if (shouldDestroyInstance) {
|
|
119
|
-
|
|
120
|
+
subHelpersObject[helperId] = null;
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
};
|
|
@@ -144,14 +145,14 @@ var raftConnectionIssueResolvedSubscriptionObserver_ = function (callback) {
|
|
|
144
145
|
/**
|
|
145
146
|
* RAFT Connected Subscription Helper
|
|
146
147
|
*/
|
|
147
|
-
var
|
|
148
|
-
|
|
149
|
-
if (!
|
|
150
|
-
|
|
148
|
+
export var raftConnectedSubscriptionHelper = function (raft, helperId) {
|
|
149
|
+
if (helperId === void 0) { helperId = 'raftConnectedSubscriptionHelper'; }
|
|
150
|
+
if (!subHelpersObject[helperId]) {
|
|
151
|
+
subHelpersObject[helperId] = createRaftConnectedHelper(raft, helperId);
|
|
151
152
|
}
|
|
152
|
-
return
|
|
153
|
+
return subHelpersObject[helperId];
|
|
153
154
|
};
|
|
154
|
-
export var createRaftConnectedHelper = function (raft) {
|
|
155
|
+
export var createRaftConnectedHelper = function (raft, helperId) {
|
|
155
156
|
var observer = null;
|
|
156
157
|
return {
|
|
157
158
|
subscribe: function (callback) {
|
|
@@ -164,7 +165,7 @@ export var createRaftConnectedHelper = function (raft) {
|
|
|
164
165
|
raft.unsubscribe(observer);
|
|
165
166
|
}
|
|
166
167
|
if (shouldDestroyInstance) {
|
|
167
|
-
|
|
168
|
+
subHelpersObject[helperId] = null;
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
};
|
|
@@ -200,14 +201,14 @@ var raftConnectedSubscriptionObserver_ = function (callback) {
|
|
|
200
201
|
/**
|
|
201
202
|
* RAFT Disconnected Subscription Helper
|
|
202
203
|
*/
|
|
203
|
-
var
|
|
204
|
-
|
|
205
|
-
if (!
|
|
206
|
-
|
|
204
|
+
export var raftDisconnectedSubscriptionHelper = function (raft, helperId) {
|
|
205
|
+
if (helperId === void 0) { helperId = 'raftDisconnectedSubscriptionHelper'; }
|
|
206
|
+
if (!subHelpersObject[helperId]) {
|
|
207
|
+
subHelpersObject[helperId] = createRaftDisconnectedHelper(raft, helperId);
|
|
207
208
|
}
|
|
208
|
-
return
|
|
209
|
+
return subHelpersObject[helperId];
|
|
209
210
|
};
|
|
210
|
-
export var createRaftDisconnectedHelper = function (raft) {
|
|
211
|
+
export var createRaftDisconnectedHelper = function (raft, helperId) {
|
|
211
212
|
var observer = null;
|
|
212
213
|
return {
|
|
213
214
|
subscribe: function (callback) {
|
|
@@ -220,7 +221,7 @@ export var createRaftDisconnectedHelper = function (raft) {
|
|
|
220
221
|
raft.unsubscribe(observer);
|
|
221
222
|
}
|
|
222
223
|
if (shouldDestroyInstance) {
|
|
223
|
-
|
|
224
|
+
subHelpersObject[helperId] = null;
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
};
|
|
@@ -256,14 +257,14 @@ var raftDisconnectedSubscriptionObserver_ = function (callback) {
|
|
|
256
257
|
/**
|
|
257
258
|
* RAFT Verified Subscription Helper
|
|
258
259
|
*/
|
|
259
|
-
var
|
|
260
|
-
|
|
261
|
-
if (!
|
|
262
|
-
|
|
260
|
+
export var raftVerifiedSubscriptionHelper = function (raft, helperId) {
|
|
261
|
+
if (helperId === void 0) { helperId = 'raftVerifiedSubscriptionHelper'; }
|
|
262
|
+
if (!subHelpersObject[helperId]) {
|
|
263
|
+
subHelpersObject[helperId] = createRaftVerifiedHelper(raft, helperId);
|
|
263
264
|
}
|
|
264
|
-
return
|
|
265
|
+
return subHelpersObject[helperId];
|
|
265
266
|
};
|
|
266
|
-
export var createRaftVerifiedHelper = function (raft) {
|
|
267
|
+
export var createRaftVerifiedHelper = function (raft, helperId) {
|
|
267
268
|
var observer = null;
|
|
268
269
|
return {
|
|
269
270
|
subscribe: function (callback) {
|
|
@@ -276,7 +277,7 @@ export var createRaftVerifiedHelper = function (raft) {
|
|
|
276
277
|
raft.unsubscribe(observer);
|
|
277
278
|
}
|
|
278
279
|
if (shouldDestroyInstance) {
|
|
279
|
-
|
|
280
|
+
subHelpersObject[helperId] = null;
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
283
|
};
|
|
@@ -311,14 +312,14 @@ var raftVerifiedSubscriptionObserver_ = function (callback) {
|
|
|
311
312
|
* Subscription Helper for raftFound event
|
|
312
313
|
* ApplicationManager
|
|
313
314
|
*/
|
|
314
|
-
var
|
|
315
|
-
|
|
316
|
-
if (!
|
|
317
|
-
|
|
315
|
+
export var raftFoundSubscriptionHelper = function (helperId) {
|
|
316
|
+
if (helperId === void 0) { helperId = 'raftFoundSubscriptionHelper'; }
|
|
317
|
+
if (!subHelpersObject[helperId]) {
|
|
318
|
+
subHelpersObject[helperId] = createRaftFoundHelper(helperId);
|
|
318
319
|
}
|
|
319
|
-
return
|
|
320
|
+
return subHelpersObject[helperId];
|
|
320
321
|
};
|
|
321
|
-
export var createRaftFoundHelper = function () {
|
|
322
|
+
export var createRaftFoundHelper = function (helperId) {
|
|
322
323
|
var observer = null;
|
|
323
324
|
return {
|
|
324
325
|
subscribe: function (callback) {
|
|
@@ -331,7 +332,7 @@ export var createRaftFoundHelper = function () {
|
|
|
331
332
|
window.applicationManager.unsubscribe(observer);
|
|
332
333
|
}
|
|
333
334
|
if (shouldDestroyInstance) {
|
|
334
|
-
|
|
335
|
+
subHelpersObject[helperId] = null;
|
|
335
336
|
}
|
|
336
337
|
}
|
|
337
338
|
};
|
|
@@ -356,14 +357,14 @@ var raftFoundSubscriptionObserver_ = function (callback) {
|
|
|
356
357
|
/**
|
|
357
358
|
* Subscription Helper for raftDiscoveryFinished event
|
|
358
359
|
*/
|
|
359
|
-
var
|
|
360
|
-
|
|
361
|
-
if (!
|
|
362
|
-
|
|
360
|
+
export var raftDiscoveryFinishedSubscriptionHelper = function (helperId) {
|
|
361
|
+
if (helperId === void 0) { helperId = 'raftDiscoveryFinishedSubscriptionHelper'; }
|
|
362
|
+
if (!subHelpersObject[helperId]) {
|
|
363
|
+
subHelpersObject[helperId] = createRaftDiscoveryFinishedHelper(helperId);
|
|
363
364
|
}
|
|
364
|
-
return
|
|
365
|
+
return subHelpersObject[helperId];
|
|
365
366
|
};
|
|
366
|
-
export var createRaftDiscoveryFinishedHelper = function () {
|
|
367
|
+
export var createRaftDiscoveryFinishedHelper = function (helperId) {
|
|
367
368
|
var observer = null;
|
|
368
369
|
return {
|
|
369
370
|
subscribe: function (callback) {
|
|
@@ -376,7 +377,7 @@ export var createRaftDiscoveryFinishedHelper = function () {
|
|
|
376
377
|
window.applicationManager.unsubscribe(observer);
|
|
377
378
|
}
|
|
378
379
|
if (shouldDestroyInstance) {
|
|
379
|
-
|
|
380
|
+
subHelpersObject[helperId] = null;
|
|
380
381
|
}
|
|
381
382
|
}
|
|
382
383
|
};
|
|
@@ -401,14 +402,14 @@ var raftDiscoveryFinishedSubscriptionObserver_ = function (callback) {
|
|
|
401
402
|
/**
|
|
402
403
|
* Subscription Helper for raftDiscoveryStarted event
|
|
403
404
|
*/
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
if (!
|
|
407
|
-
|
|
405
|
+
export var raftDiscoveryStartedSubscriptionHelper = function (helperId) {
|
|
406
|
+
if (helperId === void 0) { helperId = 'raftDiscoveryStartedSubscriptionHelper'; }
|
|
407
|
+
if (!subHelpersObject[helperId]) {
|
|
408
|
+
subHelpersObject[helperId] = createRaftDiscoveryStartedHelper(helperId);
|
|
408
409
|
}
|
|
409
|
-
return
|
|
410
|
+
return subHelpersObject[helperId];
|
|
410
411
|
};
|
|
411
|
-
export var createRaftDiscoveryStartedHelper = function () {
|
|
412
|
+
export var createRaftDiscoveryStartedHelper = function (helperId) {
|
|
412
413
|
var observer = null;
|
|
413
414
|
return {
|
|
414
415
|
subscribe: function (callback) {
|
|
@@ -421,7 +422,7 @@ export var createRaftDiscoveryStartedHelper = function () {
|
|
|
421
422
|
window.applicationManager.unsubscribe(observer);
|
|
422
423
|
}
|
|
423
424
|
if (shouldDestroyInstance) {
|
|
424
|
-
|
|
425
|
+
subHelpersObject[helperId] = null;
|
|
425
426
|
}
|
|
426
427
|
}
|
|
427
428
|
};
|
|
@@ -447,14 +448,14 @@ var raftDiscoveryStartedSubscriptionObserver_ = function (callback) {
|
|
|
447
448
|
* Subscription Helper for raftRejected event
|
|
448
449
|
* This event is triggered when the RAFT is rejected during the verification process
|
|
449
450
|
*/
|
|
450
|
-
var
|
|
451
|
-
|
|
452
|
-
if (!
|
|
453
|
-
|
|
451
|
+
export var raftRejectedSubscriptionHelper = function (raft, helperId) {
|
|
452
|
+
if (helperId === void 0) { helperId = 'raftRejectedSubscriptionHelper'; }
|
|
453
|
+
if (!subHelpersObject[helperId]) {
|
|
454
|
+
subHelpersObject[helperId] = createRaftRejectedHelper(raft, helperId);
|
|
454
455
|
}
|
|
455
|
-
return
|
|
456
|
+
return subHelpersObject[helperId];
|
|
456
457
|
};
|
|
457
|
-
export var createRaftRejectedHelper = function (raft) {
|
|
458
|
+
export var createRaftRejectedHelper = function (raft, helperId) {
|
|
458
459
|
var observer = null;
|
|
459
460
|
return {
|
|
460
461
|
subscribe: function (callback) {
|
|
@@ -467,7 +468,7 @@ export var createRaftRejectedHelper = function (raft) {
|
|
|
467
468
|
raft.unsubscribe(observer);
|
|
468
469
|
}
|
|
469
470
|
if (shouldDestroyInstance) {
|
|
470
|
-
|
|
471
|
+
subHelpersObject[helperId] = null;
|
|
471
472
|
}
|
|
472
473
|
}
|
|
473
474
|
};
|
|
@@ -498,14 +499,14 @@ var raftRejectedSubscriptionObserver_ = function (callback) {
|
|
|
498
499
|
},
|
|
499
500
|
};
|
|
500
501
|
};
|
|
501
|
-
var
|
|
502
|
-
|
|
503
|
-
if (!
|
|
504
|
-
|
|
502
|
+
export var raftPubSubscriptionHelper = function (raft, helperId) {
|
|
503
|
+
if (helperId === void 0) { helperId = 'raftPubSubscriptionHelper'; }
|
|
504
|
+
if (!subHelpersObject[helperId]) {
|
|
505
|
+
subHelpersObject[helperId] = createRaftPubSubscriptionHelper(raft, helperId);
|
|
505
506
|
}
|
|
506
|
-
return
|
|
507
|
+
return subHelpersObject[helperId];
|
|
507
508
|
};
|
|
508
|
-
export var createRaftPubSubscriptionHelper = function (raft) {
|
|
509
|
+
export var createRaftPubSubscriptionHelper = function (raft, helperId) {
|
|
509
510
|
var observer = null;
|
|
510
511
|
return {
|
|
511
512
|
subscribe: function (callback) {
|
|
@@ -518,7 +519,7 @@ export var createRaftPubSubscriptionHelper = function (raft) {
|
|
|
518
519
|
raft.unsubscribe(observer);
|
|
519
520
|
}
|
|
520
521
|
if (shouldDestroyInstance) {
|
|
521
|
-
|
|
522
|
+
subHelpersObject[helperId] = null;
|
|
522
523
|
}
|
|
523
524
|
}
|
|
524
525
|
};
|
|
@@ -110,9 +110,9 @@ function VerificationModal(_a) {
|
|
|
110
110
|
if (!connectedRAFT_)
|
|
111
111
|
return;
|
|
112
112
|
var subHelper = raftConnectingSubscriptionHelper(connectedRAFT_);
|
|
113
|
-
subHelper.subscribe(setRandomColours);
|
|
113
|
+
subHelper === null || subHelper === void 0 ? void 0 : subHelper.subscribe(setRandomColours);
|
|
114
114
|
return function () {
|
|
115
|
-
subHelper.unsubscribe();
|
|
115
|
+
subHelper === null || subHelper === void 0 ? void 0 : subHelper.unsubscribe();
|
|
116
116
|
};
|
|
117
117
|
}, [connectedRAFT_]);
|
|
118
118
|
useEffect(function () {
|
|
@@ -168,12 +168,14 @@ function VerificationModalPhoneApp(_a) {
|
|
|
168
168
|
});
|
|
169
169
|
}); };
|
|
170
170
|
useEffect(function () {
|
|
171
|
+
var _a;
|
|
171
172
|
if (!connectedRaft)
|
|
172
173
|
return;
|
|
173
|
-
raftConnectingSubscriptionHelper(connectedRaft).subscribe(setRandomColours);
|
|
174
|
+
(_a = raftConnectingSubscriptionHelper(connectedRaft)) === null || _a === void 0 ? void 0 : _a.subscribe(setRandomColours);
|
|
174
175
|
connectedRaft === null || connectedRaft === void 0 ? void 0 : connectedRaft.verifyRaftPhoneApp(foundRICsState[selectedRICIdx]);
|
|
175
176
|
return function () {
|
|
176
|
-
|
|
177
|
+
var _a;
|
|
178
|
+
(_a = raftConnectingSubscriptionHelper(connectedRaft)) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
177
179
|
};
|
|
178
180
|
}, [connectedRaft]);
|
|
179
181
|
var onSelectRaft = function (raftIdx) { return __awaiter(_this, void 0, void 0, function () {
|