Skip to content

Commit

Permalink
fix(connect): fix device getting into hanged state after app reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Jan 16, 2025
1 parent 275b92f commit 380721a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/connect-web/src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,11 @@ const TrezorConnect = factory(

export default TrezorConnect;
export * from '@trezor/connect/src/exports';

window.addEventListener('beforeunload', () => {
console.log('==================================');

Check failure on line 83 in packages/connect-web/src/module/index.ts

View workflow job for this annotation

GitHub Actions / Linting and formatting

Unexpected console statement
console.log('==================================');

Check failure on line 84 in packages/connect-web/src/module/index.ts

View workflow job for this annotation

GitHub Actions / Linting and formatting

Unexpected console statement
console.log('==================================');

Check failure on line 85 in packages/connect-web/src/module/index.ts

View workflow job for this annotation

GitHub Actions / Linting and formatting

Unexpected console statement
console.log('==================================');

Check failure on line 86 in packages/connect-web/src/module/index.ts

View workflow job for this annotation

GitHub Actions / Linting and formatting

Unexpected console statement
console.log('==================================');

Check failure on line 87 in packages/connect-web/src/module/index.ts

View workflow job for this annotation

GitHub Actions / Linting and formatting

Unexpected console statement
});
2 changes: 2 additions & 0 deletions packages/connect/src/device/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ export class Device extends TypedEmitter<DeviceEvents> {
if (fn) {
await this.initialize(!!options.useCardanoDerivation);
} else {
await this.commands?.typedCall('Cancel', 'Success').catch(() => {});

const getFeaturesTimeout =
DataManager.getSettings('env') === 'react-native'
? GET_FEATURES_TIMEOUT_REACT_NATIVE
Expand Down

0 comments on commit 380721a

Please sign in to comment.