Do not recalculate the buffer on new reaction

Only the replacement is needed as the height is already correclty
calculated when drawn.

Fixes #283
This commit is contained in:
Nicolas Peugnet 2022-11-01 16:02:30 +01:00
parent 99a5c7caed
commit 83da1df256

View File

@ -920,11 +920,10 @@ func (view *RoomView) AddReaction(evt *muksevt.Event, key string) {
// Message not in view, nothing to do // Message not in view, nothing to do
return return
} }
recalculate := len(msg.Reactions) == 0 heightChanged := len(msg.Reactions) == 0
msg.AddReaction(key) msg.AddReaction(key)
if recalculate { if heightChanged {
// Recalculate height for message // Replace buffer to update height of message
msg.CalculateBuffer(msgView.prevPrefs, msgView.prevWidth())
msgView.replaceBuffer(msg, msg) msgView.replaceBuffer(msg, msg)
} }
} }