Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e31b126

Browse files
authored
Use device IDs for nameless devices in device list (#7081)
1 parent bd2f4b6 commit e31b126

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/components/views/settings/DevicesPanelEntry.tsx

+11-3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ export default class DevicesPanelEntry extends React.Component<IProps, IState> {
157157
<StyledCheckbox kind={CheckboxStyle.Outline} onChange={this.onDeviceToggled} checked={this.props.selected} />
158158
</div>;
159159

160+
const deviceName = device.display_name ?
161+
<React.Fragment>
162+
<TextWithTooltip tooltip={device.display_name + " (" + device.device_id + ")"}>
163+
{ device.display_name }
164+
</TextWithTooltip>
165+
</React.Fragment> :
166+
<React.Fragment>
167+
{ device.device_id }
168+
</React.Fragment>;
169+
160170
const buttons = this.state.renaming ?
161171
<form className="mx_DevicesPanel_renameForm" onSubmit={this.onRenameSubmit}>
162172
<Field
@@ -182,9 +192,7 @@ export default class DevicesPanelEntry extends React.Component<IProps, IState> {
182192
{ left }
183193
<div className="mx_DevicesPanel_deviceInfo">
184194
<div className="mx_DevicesPanel_deviceName">
185-
<TextWithTooltip tooltip={device.display_name + " (" + device.device_id + ")"}>
186-
{ device.display_name }
187-
</TextWithTooltip>
195+
{ deviceName }
188196
</div>
189197
<div className="mx_DevicesPanel_lastSeen">
190198
{ lastSeen }

0 commit comments

Comments
 (0)