fix(StatusChatListItem): ensure public chat names are prefixed with '#'

Closes #191
This commit is contained in:
Pascal Precht 2021-06-25 12:33:30 +02:00 committed by Pascal Precht
parent a98bae48dd
commit 141872c2a5
2 changed files with 5 additions and 2 deletions

View File

@ -678,7 +678,7 @@ Rectangle {
} }
ListElement { ListElement {
chatId: "1" chatId: "1"
name: "#status-desktop" name: "status-desktop"
chatType: StatusChatListItem.Type.PublicChat chatType: StatusChatListItem.Type.PublicChat
muted: false muted: false
hasUnreadMessages: true hasUnreadMessages: true

View File

@ -145,7 +145,10 @@ Rectangle {
anchors.leftMargin: statusIcon.visible ? 1 : 8 anchors.leftMargin: statusIcon.visible ? 1 : 8
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: statusChatListItem.name text: statusChatListItem.type === StatusChatListItem.Type.PublicChat &&
!statusChatListItem.name.startsWith("#") ?
"#" + statusChatListItem.name :
statusChatListItem.name
color: { color: {
if (statusChatListItem.muted && !sensor.containsMouse && !statusChatListItem.highlighted) { if (statusChatListItem.muted && !sensor.containsMouse && !statusChatListItem.highlighted) {
return Theme.palette.directColor5 return Theme.palette.directColor5