From 5b421f02d807538654d5c6128f23cede854f3e1f Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 21 Jul 2019 07:48:56 -0400 Subject: [PATCH] Avoid some more avatar errors when forgetting room --- src/qml/Base/HRoomAvatar.qml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/qml/Base/HRoomAvatar.qml b/src/qml/Base/HRoomAvatar.qml index e040f2dc..0075778b 100644 --- a/src/qml/Base/HRoomAvatar.qml +++ b/src/qml/Base/HRoomAvatar.qml @@ -9,15 +9,11 @@ HAvatar { readonly property var roomInfo: rooms.getWhere({userId, roomId}, 1)[0] - // roomInfo ? → Avoid error messages when a room is forgotten + // Avoid error messages when a room is forgotten readonly property var dname: roomInfo ? roomInfo.displayName : "" + readonly property var avUrl: roomInfo ? roomInfo.avatarUrl : "" - name: - dname[0] == "#" && dname.length > 1 ? dname.substring(1) : dname - - imageUrl: - roomInfo.avatarUrl ? ("image://python/" + roomInfo.avatarUrl) : null - - toolTipImageUrl: - roomInfo.avatarUrl ? ("image://python/" + roomInfo.avatarUrl) : null + name: dname[0] == "#" && dname.length > 1 ? dname.substring(1) : dname + imageUrl: avUrl ? ("image://python/" + avUrl) : null + toolTipImageUrl: avUrl ? ("image://python/" + avUrl) : null }