Skip to content

Commit

Permalink
fix(suite): synchronize calls to connect
Browse files Browse the repository at this point in the history
(cherry picked from commit 0675374)
  • Loading branch information
mroz22 authored and komret committed Nov 6, 2023
1 parent 99636a4 commit 8612617
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion suite-common/connect-init/src/connectInitThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import TrezorConnect, {
TRANSPORT_EVENT,
UI_EVENT,
} from '@trezor/connect';
import { getSynchronize } from '@trezor/utils';

import { cardanoConnectPatch } from './cardanoConnectPatch';

Expand Down Expand Up @@ -49,6 +50,8 @@ export const connectInitThunk = createThunk(
dispatch(action);
});

const synchronize = getSynchronize();

const wrappedMethods = [
'getFeatures',
'getDeviceState',
Expand Down Expand Up @@ -80,7 +83,7 @@ export const connectInitThunk = createThunk(
if (!original) return;
(TrezorConnect[key] as any) = async (params: any) => {
dispatch(lockDevice(true));
const result = await original(params);
const result = await synchronize(() => original(params));
dispatch(lockDevice(false));
return result;
};
Expand Down

0 comments on commit 8612617

Please sign in to comment.