Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Oct 14, 2024
1 parent 08bbef3 commit a969d8a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/connect/src/device/Device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,7 @@ export class Device extends TypedEmitter<DeviceEvents> {
const base = {
path,
name,
descriptor: this.originalDescriptor,
};
if (this.unreadableError) {
return {
Expand Down
2 changes: 2 additions & 0 deletions packages/connect/src/types/device.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Descriptor } from '@trezor/transport';
import type { PROTO } from '../constants';
import type { ReleaseInfo } from './firmware';

Expand Down Expand Up @@ -68,6 +69,7 @@ export type FirmwareHashCheckResult =
type BaseDevice = {
path: string;
name: string;
descriptor: Descriptor;
};

export type KnownDevice = BaseDevice & {
Expand Down
2 changes: 2 additions & 0 deletions packages/suite/src/components/suite/ConnectDevicePrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const getMessageId = ({
return isDesktop() ? 'TR_NO_TRANSPORT_DESKTOP' : 'TR_NO_TRANSPORT';
case 'device-bootloader':
return 'TR_DEVICE_CONNECTED_BOOTLOADER';
case 'device-unacquired':
return 'TR_DEVICE_CONNECTED_UNACQUIRED';
default: {
if (connected) {
return !showWarning ? 'TR_DEVICE_CONNECTED' : 'TR_DEVICE_CONNECTED_WRONG_STATE';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ export const DeviceAcquire = () => {
const tips = [
{
key: 'device-meow',
heading: 'Device used elsewhere',
// @ts-expect-error
description: device.sessionOwner,
heading: <Translation id="TR_DEVICE_CONNECTED_UNACQUIRED" />,
description: (
<Translation
id="TR_DEVICE_CONNECTED_UNACQUIRED_DESCRIPTION"
values={{
sessionOwner: device!.descriptor.sessionOwner,
}}
/>
),
},
{
key: 'device-acquire',
Expand Down
9 changes: 9 additions & 0 deletions packages/suite/src/support/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6771,6 +6771,15 @@ export default defineMessages({
id: 'TR_DEVICE_CONNECTED_BOOTLOADER_RECONNECT_IN_NORMAL_NO_TOUCH',
defaultMessage: 'Reconnect the device without touching the screen.',
},
TR_DEVICE_CONNECTED_UNACQUIRED: {
id: 'TR_DEVICE_CONNECTED_UNACQUIRED',
defaultMessage: 'Device used elsewhere',
},
TR_DEVICE_CONNECTED_UNACQUIRED_DESCRIPTION: {
id: 'TR_DEVICE_CONNECTED_UNACQUIRED_DESCRIPTION',
defaultMessage:
'App {sessionOwner} might be using the device right now. You may take the device for yourself.',
},
TR_WIPE_OR_UPDATE: {
id: 'TR_WIPE_OR_UPDATE',
defaultMessage: 'Reset device or update firmware',
Expand Down

0 comments on commit a969d8a

Please sign in to comment.