Remove forgotten rooms from the view

This commit is contained in:
miruka
2019-07-07 22:19:17 -04:00
parent 47327c64cf
commit b02fc11903
9 changed files with 26 additions and 20 deletions

View File

@@ -3,8 +3,10 @@ import QtQuick 2.7
HAvatar {
property string roomId: ""
// roomInfo ? → Avoid error messages when a room is forgotten
readonly property var roomInfo: rooms.getWhere({"roomId": roomId}, 1)[0]
readonly property var dname: roomInfo.displayName
readonly property var dname: roomInfo ? roomInfo.displayName : ""
name: dname[0] == "#" && dname.length > 1 ? dname.substring(1) : dname
imageUrl: roomInfo.avatarUrl
imageUrl: roomInfo ? roomInfo.avatarUrl : null
}