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

Commit 5d75357

Browse files
committed
Show device ID in UserInfo when there is no device name
Signed-off-by: Aaron Raimist <[email protected]>
1 parent 68210b1 commit 5d75357

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/views/right_panel/UserInfo.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,15 @@ function DeviceItem({userId, device}: {userId: string, device: IDevice}) {
187187
verifyDevice(cli.getUser(userId), device);
188188
};
189189

190-
const deviceName = device.ambiguous ?
191-
(device.getDisplayName() ? device.getDisplayName() : "") + " (" + device.deviceId + ")" :
192-
device.getDisplayName();
190+
let deviceName;
191+
if (device.getDisplayName() === null || device.getDisplayName().trim() === "") {
192+
deviceName = device.deviceId;
193+
} else {
194+
deviceName = device.ambiguous ?
195+
device.getDisplayName() + " (" + device.deviceId + ")" :
196+
device.getDisplayName();
197+
}
198+
193199
let trustedLabel = null;
194200
if (userTrust.isVerified()) trustedLabel = isVerified ? _t("Trusted") : _t("Not trusted");
195201

0 commit comments

Comments
 (0)