Skip to content

Commit

Permalink
A few more usb port display locations
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Jan 31, 2025
1 parent ebb9fc4 commit 6158d14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/src/molecules/ModuleInfo/ModuleInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export const ModuleInfo = (props: ModuleInfoProps): JSX.Element => {
if (physicalPort === null && isAttached) {
connectionStatus = t('usb_connected_no_port_info')
} else if (physicalPort != null && isAttached) {
connectionStatus = t('usb_port_connected', { port: physicalPort.port })
const portDisplay =
physicalPort?.hubPort != null
? `${physicalPort.port}.${physicalPort.hubPort}`
: physicalPort?.port
connectionStatus = t('usb_port_connected', { port: portDisplay })
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ export function ModulesListItem({
// convert slot name to cutout id
const cutoutIdForSlotName = getCutoutIdForSlotName(slotName, deckDef)

const portDisplay =
attachedModuleMatch?.usbPort?.hubPort != null
? `${attachedModuleMatch.usbPort.port}.${attachedModuleMatch.usbPort.hubPort}`
: attachedModuleMatch?.usbPort?.port

return (
<>
{showLocationConflictModal && cutoutIdForSlotName != null ? (
Expand Down Expand Up @@ -369,10 +374,10 @@ export function ModulesListItem({
: TC_MODULE_LOCATION_OT2
: slotName}
</LegacyStyledText>
{attachedModuleMatch?.usbPort.port != null ? (
{portDisplay != null ? (
<LegacyStyledText as="p">
{t('usb_port_number', {
port: attachedModuleMatch.usbPort.port,
port: portDisplay,
})}
</LegacyStyledText>
) : null}
Expand Down

0 comments on commit 6158d14

Please sign in to comment.