Skip to content

Commit

Permalink
meow
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Jan 16, 2025
1 parent b9941df commit 2b86877
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/connect-web/src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const impl = new TrezorConnectDynamic<
type: 'core-in-module',
impl: new CoreInModule((message: CoreEventMessage) => {
if (message.event === TRANSPORT_EVENT) {
// note: udev and bridge are part of the event already emitted from "core" but without "preferred" field set
const platform = getInstallerPackage();
message.payload.bridge = cloneObject(suggestBridgeInstaller(platform));
message.payload.udev = cloneObject(suggestUdevInstaller(platform));
Expand Down
12 changes: 11 additions & 1 deletion packages/connect/src/events/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { TRANSPORT } from '@trezor/transport/src/constants';
import { serializeError } from '../constants/errors';
import type { MessageFactoryFn } from '../types/utils';
import { ConnectSettings } from '../exports';
import { suggestBridgeInstaller } from '../data/transportInfo';
import { suggestUdevInstaller } from '../data/udevInfo';

export { TRANSPORT } from '@trezor/transport/src/constants';

Expand Down Expand Up @@ -89,5 +91,13 @@ export const createTransportMessage: MessageFactoryFn<typeof TRANSPORT_EVENT, Tr
({
event: TRANSPORT_EVENT,
type,
payload: 'error' in payload ? serializeError(payload) : payload,
payload:
'error' in payload
? serializeError(payload)
: // suggest udev installer without setting "preferred" field
{
...payload,
udev: suggestUdevInstaller(),
bridge: suggestBridgeInstaller(),
},
}) as any;

0 comments on commit 2b86877

Please sign in to comment.