Display edits. Additional condition check.

This commit is contained in:
Black Hat
2019-08-08 12:11:33 +08:00
parent 415285b376
commit 8c2d867f18
3 changed files with 8 additions and 2 deletions

View File

@@ -289,7 +289,7 @@ Item {
}
}
RippleEffect {
AutoMouseArea {
anchors.fill: parent
onPrimaryClicked: {

View File

@@ -138,6 +138,9 @@ void MessageEventModel::setRoom(SpectralRoom* room) {
});
connect(m_currentRoom, &Room::updatedEvent, this,
[this](const QString& eventId) {
if (eventId.isEmpty()) { // How did we get here?
return;
}
refreshEventRoles(eventId, {ReactionRole, Qt::DisplayRole});
});
connect(m_currentRoom, &Room::fileTransferProgress, this,

View File

@@ -152,7 +152,10 @@ void SpectralRoom::onAddHistoricalTimelineEvents(rev_iter_t from) {
void SpectralRoom::onRedaction(const RoomEvent& prevEvent,
const RoomEvent& /*after*/) {
if (const auto& e = eventCast<const ReactionEvent>(&prevEvent)) {
emit updatedEvent(e->relation().eventId);
if (auto relatedEventId = e->relation().eventId;
!relatedEventId.isEmpty()) {
emit updatedEvent(relatedEventId);
}
}
}