Skip to content

Commit 6158d14

Browse files
committed
A few more usb port display locations
1 parent ebb9fc4 commit 6158d14

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

app/src/molecules/ModuleInfo/ModuleInfo.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ export const ModuleInfo = (props: ModuleInfoProps): JSX.Element => {
4848
if (physicalPort === null && isAttached) {
4949
connectionStatus = t('usb_connected_no_port_info')
5050
} else if (physicalPort != null && isAttached) {
51-
connectionStatus = t('usb_port_connected', { port: physicalPort.port })
51+
const portDisplay =
52+
physicalPort?.hubPort != null
53+
? `${physicalPort.port}.${physicalPort.hubPort}`
54+
: physicalPort?.port
55+
connectionStatus = t('usb_port_connected', { port: portDisplay })
5256
}
5357

5458
return (

app/src/organisms/Desktop/Devices/ProtocolRun/SetupModuleAndDeck/SetupModulesList.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ export function ModulesListItem({
298298
// convert slot name to cutout id
299299
const cutoutIdForSlotName = getCutoutIdForSlotName(slotName, deckDef)
300300

301+
const portDisplay =
302+
attachedModuleMatch?.usbPort?.hubPort != null
303+
? `${attachedModuleMatch.usbPort.port}.${attachedModuleMatch.usbPort.hubPort}`
304+
: attachedModuleMatch?.usbPort?.port
305+
301306
return (
302307
<>
303308
{showLocationConflictModal && cutoutIdForSlotName != null ? (
@@ -369,10 +374,10 @@ export function ModulesListItem({
369374
: TC_MODULE_LOCATION_OT2
370375
: slotName}
371376
</LegacyStyledText>
372-
{attachedModuleMatch?.usbPort.port != null ? (
377+
{portDisplay != null ? (
373378
<LegacyStyledText as="p">
374379
{t('usb_port_number', {
375-
port: attachedModuleMatch.usbPort.port,
380+
port: portDisplay,
376381
})}
377382
</LegacyStyledText>
378383
) : null}

0 commit comments

Comments
 (0)