Fix reply colors being broken if you're faster than the server
This is that bug that causes reply colors to be white, and this error to print in the log: qrc:/qt/qml/org/kde/neochat/messagecontent/ReplyComponent.qml:41: TypeError: Cannot read property 'color' of null The reason why this happens is inside of EventMessageContentModel, it needs to be able to find the relevant event in the room to fetch the room member (and then their color.) Dependent on many variables to align, this can happen easily if you are faster than your server giving you said events. But this is an easy fix, we obviously get the event afterwards and just need to re-evaluate the the author property. I also made sure it falls back to some color instead of white, which will also quiet the error.
This commit is contained in:
@@ -38,7 +38,7 @@ RowLayout {
|
||||
Layout.fillHeight: true
|
||||
|
||||
implicitWidth: Kirigami.Units.smallSpacing
|
||||
color: root.replyContentModel.author.color
|
||||
color: root.replyContentModel.author?.color ?? Kirigami.Theme.highlightColor
|
||||
radius: Kirigami.Units.cornerRadius
|
||||
}
|
||||
ColumnLayout {
|
||||
|
||||
Reference in New Issue
Block a user