1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-10 09:22:25 +03:00

Show device ID in UserInfo when there is no device name

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist
2021-05-06 20:01:48 -05:00
parent 68210b1415
commit 5d7535738a

View File

@@ -187,9 +187,15 @@ function DeviceItem({userId, device}: {userId: string, device: IDevice}) {
verifyDevice(cli.getUser(userId), device); verifyDevice(cli.getUser(userId), device);
}; };
const deviceName = device.ambiguous ? let deviceName;
(device.getDisplayName() ? device.getDisplayName() : "") + " (" + device.deviceId + ")" : if (device.getDisplayName() === null || device.getDisplayName().trim() === "") {
device.getDisplayName(); deviceName = device.deviceId;
} else {
deviceName = device.ambiguous ?
device.getDisplayName() + " (" + device.deviceId + ")" :
device.getDisplayName();
}
let trustedLabel = null; let trustedLabel = null;
if (userTrust.isVerified()) trustedLabel = isVerified ? _t("Trusted") : _t("Not trusted"); if (userTrust.isVerified()) trustedLabel = isVerified ? _t("Trusted") : _t("Not trusted");