Skip to content

Commit

Permalink
chore(suite-desktop): enable trezor-connect logger when debug mode is…
Browse files Browse the repository at this point in the history
… active
  • Loading branch information
mroz22 committed Feb 3, 2025
1 parent f800602 commit 343922b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/suite-desktop-core/src/modules/trezor-connect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ipcMain } from 'electron';
import { app, ipcMain } from 'electron';

import TrezorConnect, { DEVICE_EVENT } from '@trezor/connect';
import { IpcProxyHandlerOptions, createIpcProxyHandler } from '@trezor/ipc-proxy';
Expand Down Expand Up @@ -56,7 +56,12 @@ export const initBackground: ModuleInitBackground = ({ mainThreadEmitter, store
onRequest: async (method, params) => {
logger.debug(SERVICE_NAME, `call ${method}`);
if (method === 'init') {
const response = await TrezorConnect[method](...params);
const response = await TrezorConnect.init({
...params[0],
// poor mans solution to enable debug logs in trezor-connect.
// todo: ideally connect should accept logger as a param
debug: app?.commandLine.getSwitchValue('log-connect') === 'true',
});
await setProxy();

return response;
Expand Down

0 comments on commit 343922b

Please sign in to comment.