@swan-admin/swan-ai-measurements 1.0.30 → 1.0.31
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/measurement.js +5 -5
- package/package.json +1 -1
package/measurement.js
CHANGED
|
@@ -11,13 +11,13 @@ import { checkParameters } from "./utils.js";
|
|
|
11
11
|
|
|
12
12
|
export default class Measurement {
|
|
13
13
|
static accessKey;
|
|
14
|
-
constructor(key) {
|
|
15
|
-
Measurement.accessKey = key;
|
|
16
|
-
}
|
|
17
14
|
static tryOnSocketRef = null;
|
|
18
15
|
static measurementSocketRef = null;
|
|
19
16
|
static timerPollingRef = null;
|
|
20
17
|
static timerWaitingRef = null;
|
|
18
|
+
constructor(key) {
|
|
19
|
+
Measurement.accessKey = key;
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
getMeasurementStatus(scanId) {
|
|
23
23
|
if (!scanId) {
|
|
@@ -70,7 +70,7 @@ export default class Measurement {
|
|
|
70
70
|
|
|
71
71
|
static getMeasurementsCheck = async (onSuccess, onError, scanId) => {
|
|
72
72
|
try {
|
|
73
|
-
const res = await getMeasurementStatus(scanId);
|
|
73
|
+
const res = await this.getMeasurementStatus(scanId);
|
|
74
74
|
if (res?.data && res?.data?.[0]?.isMeasured === true) {
|
|
75
75
|
onSuccess?.(res?.data);
|
|
76
76
|
clearInterval(Measurement.timerPollingRef);
|
|
@@ -96,7 +96,7 @@ export default class Measurement {
|
|
|
96
96
|
static handleTimeOut = (onSuccess, onError) => {
|
|
97
97
|
Measurement.timerWaitingRef = setTimeout(() => {
|
|
98
98
|
Measurement.handlePolling(onSuccess, onError);
|
|
99
|
-
disconnectSocket();
|
|
99
|
+
Measurement.disconnectSocket();
|
|
100
100
|
}, 2 * 60000);
|
|
101
101
|
};
|
|
102
102
|
|