@onekeyfe/hd-ble-sdk 0.1.57 → 0.1.59
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/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/package.json +5 -5
- package/src/index.ts +14 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAA0B,QAAQ,EAAqB,MAAM,qBAAqB,CAAC;AAU1F,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;CAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAA0B,QAAQ,EAAqB,MAAM,qBAAqB,CAAC;AAU1F,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;CAAO,CAAC;AAwIpE,QAAA,MAAM,cAAc,qCAOlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -535,12 +535,26 @@ const cancel = (connectId) => {
|
|
|
535
535
|
_core.handleMessage({ event: HardwareSdk.IFRAME.CANCEL, type: HardwareSdk.IFRAME.CANCEL, payload: { connectId } });
|
|
536
536
|
};
|
|
537
537
|
function handleMessage(message) {
|
|
538
|
-
|
|
538
|
+
var _a;
|
|
539
|
+
const { event, type } = message;
|
|
539
540
|
if (!_core) {
|
|
540
541
|
return;
|
|
541
542
|
}
|
|
542
543
|
if (event !== HardwareSdk.LOG_EVENT) {
|
|
543
|
-
|
|
544
|
+
try {
|
|
545
|
+
if (type === HardwareSdk.UI_REQUEST.FIRMWARE_PROGRESS) {
|
|
546
|
+
Log.debug('hd-ble-sdk handleMessage', {
|
|
547
|
+
event,
|
|
548
|
+
type,
|
|
549
|
+
progress: (_a = message === null || message === void 0 ? void 0 : message.payload) === null || _a === void 0 ? void 0 : _a.progress,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
Log.debug('hd-ble-sdk handleMessage', JSON.stringify(message));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
catch (error) {
|
|
557
|
+
}
|
|
544
558
|
}
|
|
545
559
|
switch (event) {
|
|
546
560
|
case HardwareSdk.UI_EVENT:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-ble-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
4
4
|
"author": "OneKey",
|
|
5
5
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-core": "^0.1.
|
|
24
|
-
"@onekeyfe/hd-shared": "^0.1.
|
|
25
|
-
"@onekeyfe/hd-transport-react-native": "^0.1.
|
|
23
|
+
"@onekeyfe/hd-core": "^0.1.59",
|
|
24
|
+
"@onekeyfe/hd-shared": "^0.1.59",
|
|
25
|
+
"@onekeyfe/hd-transport-react-native": "^0.1.59"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "0c3e0637734a8b23d0553cf3d6a81b1bcd038116"
|
|
28
28
|
}
|
package/src/index.ts
CHANGED
|
@@ -52,13 +52,25 @@ const cancel = (connectId?: string) => {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
function handleMessage(message: CoreMessage) {
|
|
55
|
-
const { event } = message;
|
|
55
|
+
const { event, type } = message;
|
|
56
56
|
if (!_core) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (event !== LOG_EVENT) {
|
|
61
|
-
|
|
61
|
+
try {
|
|
62
|
+
if (type === UI_REQUEST.FIRMWARE_PROGRESS) {
|
|
63
|
+
Log.debug('hd-ble-sdk handleMessage', {
|
|
64
|
+
event,
|
|
65
|
+
type,
|
|
66
|
+
progress: message?.payload?.progress,
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
Log.debug('hd-ble-sdk handleMessage', JSON.stringify(message));
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
// ignore
|
|
73
|
+
}
|
|
62
74
|
}
|
|
63
75
|
switch (event) {
|
|
64
76
|
case UI_EVENT:
|