@onekeyfe/hd-ble-sdk
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -576,2 +576,3 @@ 'use strict'; | ||
const call = (params) => __awaiter(void 0, void 0, void 0, function* () { | ||
var _a, _b; | ||
Log.debug('call: ', params); | ||
@@ -582,2 +583,11 @@ try { | ||
Log.debug('response: ', response); | ||
if (!response.success) { | ||
if ((typeof response.payload === 'string' && response.payload.includes(ReactNativeTransport.PERMISSION_ERROR)) || | ||
((_a = response.payload.error) === null || _a === void 0 ? void 0 : _a.includes(ReactNativeTransport.PERMISSION_ERROR))) { | ||
postMessage(HardwareSdk.createUiMessage(HardwareSdk.UI_REQUEST.BLUETOOTH_PERMISSION), false); | ||
} | ||
if ((_b = response.payload.error) === null || _b === void 0 ? void 0 : _b.includes(ReactNativeTransport.LOCATION_ERROR)) { | ||
postMessage(HardwareSdk.createUiMessage(HardwareSdk.UI_REQUEST.LOCATION_PERMISSION), false); | ||
} | ||
} | ||
return response; | ||
@@ -584,0 +594,0 @@ } |
{ | ||
"name": "@onekeyfe/hd-ble-sdk", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": "OneKey", | ||
@@ -23,6 +23,6 @@ "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", | ||
"dependencies": { | ||
"@onekeyfe/hd-core": "^0.0.5", | ||
"@onekeyfe/hd-transport-react-native": "^0.0.5" | ||
"@onekeyfe/hd-core": "^0.0.6", | ||
"@onekeyfe/hd-transport-react-native": "^0.0.6" | ||
}, | ||
"gitHead": "24d2a28fd3f2e7fda4c21742e968bce764985615" | ||
"gitHead": "b37ddf4e02812f40a01ec38ffef2ff6cdcad4bbc" | ||
} |
@@ -10,2 +10,3 @@ import EventEmitter from 'events'; | ||
createErrorMessage, | ||
createUiMessage, | ||
CORE_EVENT, | ||
@@ -19,4 +20,8 @@ CoreMessage, | ||
UiResponseEvent, | ||
UI_REQUEST, | ||
} from '@onekeyfe/hd-core'; | ||
import ReactNativeTransport from '@onekeyfe/hd-transport-react-native'; | ||
import ReactNativeTransport, { | ||
PERMISSION_ERROR, | ||
LOCATION_ERROR, | ||
} from '@onekeyfe/hd-transport-react-native'; | ||
@@ -107,2 +112,19 @@ const eventEmitter = new EventEmitter(); | ||
Log.debug('response: ', response); | ||
if (!response.success) { | ||
if ( | ||
(typeof response.payload === 'string' && response.payload.includes(PERMISSION_ERROR)) || | ||
response.payload.error?.includes(PERMISSION_ERROR) | ||
) { | ||
/** | ||
* Send message notification when there is no Bluetooth access permission | ||
*/ | ||
postMessage(createUiMessage(UI_REQUEST.BLUETOOTH_PERMISSION), false); | ||
} | ||
if (response.payload.error?.includes(LOCATION_ERROR)) { | ||
postMessage(createUiMessage(UI_REQUEST.LOCATION_PERMISSION), false); | ||
} | ||
} | ||
return response; | ||
@@ -109,0 +131,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24610
659
+ Added@onekeyfe/hd-core@0.0.6(transitive)
+ Added@onekeyfe/hd-transport@0.0.6(transitive)
+ Added@onekeyfe/hd-transport-react-native@0.0.6(transitive)
- Removed@onekeyfe/hd-core@0.0.5(transitive)
- Removed@onekeyfe/hd-transport@0.0.5(transitive)
- Removed@onekeyfe/hd-transport-react-native@0.0.5(transitive)
Updated@onekeyfe/hd-core@^0.0.6