From 5d7535738ab6001ab581d47621d75171df6da413 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 6 May 2021 20:01:48 -0500 Subject: [PATCH 1/2] Show device ID in UserInfo when there is no device name Signed-off-by: Aaron Raimist --- src/components/views/right_panel/UserInfo.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index be152d91bd..e50e71535d 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -187,9 +187,15 @@ function DeviceItem({userId, device}: {userId: string, device: IDevice}) { verifyDevice(cli.getUser(userId), device); }; - const deviceName = device.ambiguous ? - (device.getDisplayName() ? device.getDisplayName() : "") + " (" + device.deviceId + ")" : - device.getDisplayName(); + let deviceName; + if (device.getDisplayName() === null || device.getDisplayName().trim() === "") { + deviceName = device.deviceId; + } else { + deviceName = device.ambiguous ? + device.getDisplayName() + " (" + device.deviceId + ")" : + device.getDisplayName(); + } + let trustedLabel = null; if (userTrust.isVerified()) trustedLabel = isVerified ? _t("Trusted") : _t("Not trusted"); From fa307ee14c68da1f597ee530ccf603bff9bffcd4 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 7 May 2021 18:41:47 -0500 Subject: [PATCH 2/2] Update src/components/views/right_panel/UserInfo.tsx Co-authored-by: Michael Telatynski <7t3chguy@googlemail.com> --- src/components/views/right_panel/UserInfo.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index e50e71535d..3c35a55395 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -188,7 +188,7 @@ function DeviceItem({userId, device}: {userId: string, device: IDevice}) { }; let deviceName; - if (device.getDisplayName() === null || device.getDisplayName().trim() === "") { + if (!device.getDisplayName()?.trim()) { deviceName = device.deviceId; } else { deviceName = device.ambiguous ?