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

Commit 95b43d1

Browse files
authored
Merge pull request #5985 from aaronraimist/blank-device-name
Show device ID in UserInfo when there is no device name
2 parents 1b372b1 + fa307ee commit 95b43d1

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()?.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)