@onekeyfe/hd-core
Advanced tools
Comparing version 0.1.22 to 0.1.23
{ | ||
"name": "@onekeyfe/hd-core", | ||
"version": "0.1.22", | ||
"version": "0.1.23", | ||
"description": "> TODO: description", | ||
@@ -28,4 +28,4 @@ "author": "OneKey", | ||
"dependencies": { | ||
"@onekeyfe/hd-shared": "^0.1.22", | ||
"@onekeyfe/hd-transport": "^0.1.22", | ||
"@onekeyfe/hd-shared": "^0.1.23", | ||
"@onekeyfe/hd-transport": "^0.1.23", | ||
"axios": "^0.27.2", | ||
@@ -41,3 +41,3 @@ "bignumber.js": "^9.0.2", | ||
}, | ||
"gitHead": "ebc730c7be2b0d11fc8ec5f3ee08b1440d345c7a" | ||
"gitHead": "1d460705e90267f20fff95c9cd118c8ba818c7bc" | ||
} |
@@ -77,3 +77,6 @@ import semver from 'semver'; | ||
if (callApiQueue.length > 1) { | ||
Log.debug('should cancel the previous method execution: ', callApiQueue); | ||
Log.debug( | ||
'should cancel the previous method execution: ', | ||
callApiQueue.map(m => m.name) | ||
); | ||
} | ||
@@ -205,9 +208,11 @@ | ||
// remove method from queue | ||
const index = | ||
messageResponse && messageResponse.id | ||
? callApiQueue.findIndex(m => m.responseID === messageResponse.id) | ||
: -1; | ||
const index = method.responseID | ||
? callApiQueue.findIndex(m => m.responseID === method.responseID) | ||
: -1; | ||
if (index > -1) { | ||
callApiQueue.splice(index, 1); | ||
Log.debug('Remove the finished method from the queue: ', callApiQueue); | ||
Log.debug( | ||
'Remove the finished method from the queue: ', | ||
callApiQueue.map(m => m.name) | ||
); | ||
} | ||
@@ -367,2 +372,3 @@ | ||
HardwareErrorCode.BleCharacteristicNotifyError, | ||
HardwareErrorCode.BleWriteCharacteristicError, | ||
].includes(error.errorCode) | ||
@@ -369,0 +375,0 @@ ) { |
@@ -321,18 +321,21 @@ import EventEmitter from 'events'; | ||
if (!this.isUsedHere() || this.commands.disposed) { | ||
await this.acquire(); | ||
try { | ||
if (fn) { | ||
await this.initialize(); | ||
const env = DataManager.getSettings('env'); | ||
if (env !== 'react-native') { | ||
await this.acquire(); | ||
try { | ||
if (fn) { | ||
await this.initialize(); | ||
} | ||
} catch (error) { | ||
this.runPromise = null; | ||
if (error instanceof HardwareError) { | ||
return Promise.reject(error); | ||
} | ||
return Promise.reject( | ||
ERRORS.TypedError( | ||
HardwareErrorCode.DeviceInitializeFailed, | ||
`Initialize failed: ${error.message as string}, code: ${error.code as string}` | ||
) | ||
); | ||
} | ||
} catch (error) { | ||
this.runPromise = null; | ||
if (error instanceof HardwareError) { | ||
return Promise.reject(error); | ||
} | ||
return Promise.reject( | ||
ERRORS.TypedError( | ||
HardwareErrorCode.DeviceInitializeFailed, | ||
`Initialize failed: ${error.message as string}, code: ${error.code as string}` | ||
) | ||
); | ||
} | ||
@@ -339,0 +342,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
1142121
33994