File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,9 @@ class EventObserver {
154
154
}
155
155
}
156
156
157
+ const wait = ( ms : number ) : Promise < void > =>
158
+ new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ;
159
+
157
160
export const handleHardwareWalletRequests = async (
158
161
mainWindow : BrowserWindow ,
159
162
{
@@ -279,11 +282,13 @@ export const handleHardwareWalletRequests = async (
279
282
logger . info ( '[HW-DEBUG] getHardwareWalletTransportChannel' , {
280
283
devicePath,
281
284
} ) ;
285
+ // Connected Trezor device info
286
+ let deviceFeatures : Unsuccessful | Success < Features > ;
282
287
283
288
if ( isTrezor ) {
284
289
logger . info ( '[HW-DEBUG] getHardwareWalletTransportChannel::TREZOR ' ) ;
285
290
286
- const deviceFeatures = await getTrezorDeviceFeatures ( ) ;
291
+ deviceFeatures = await getTrezorDeviceFeatures ( ) ;
287
292
288
293
try {
289
294
logger . info ( '[TREZOR-CONNECT] Called TrezorConnect.getFeatures()' ) ;
@@ -878,6 +883,13 @@ export const handleHardwareWalletRequests = async (
878
883
879
884
resetTrezorActionChannel . onRequest ( async ( ) => {
880
885
logger . info ( '[TREZOR-CONNECT] Called TrezorConnect.cancel()' ) ;
881
- TrezorConnect . cancel ( ) ;
886
+
887
+ try {
888
+ TrezorConnect . cancel ( ) ;
889
+ } catch ( error ) {
890
+ logger . warn (
891
+ '[TREZOR-CONNECT] Failed to cancel the operation:' + error . error
892
+ ) ;
893
+ }
882
894
} ) ;
883
895
} ;
You can’t perform that action at this time.
0 commit comments