mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
Decrypt last events first to avoid shifts when scrolling up
This commit is contained in:
parent
fa30285c6b
commit
6e3f8d6a0a
@ -1142,7 +1142,12 @@ class TimelinePanel extends React.Component {
|
|||||||
_getEvents() {
|
_getEvents() {
|
||||||
const events = this._timelineWindow.getEvents();
|
const events = this._timelineWindow.getEvents();
|
||||||
|
|
||||||
|
|
||||||
|
// `slice` performs a shallow copy of the array
|
||||||
|
// we want the last event to be decrypted first but displayed last
|
||||||
|
// `reverse` is destructive and unfortunately mutates the "events" array
|
||||||
events
|
events
|
||||||
|
.slice().reverse()
|
||||||
.forEach(event => {
|
.forEach(event => {
|
||||||
if (event.shouldAttemptDecryption()) {
|
if (event.shouldAttemptDecryption()) {
|
||||||
event.attemptDecryption(MatrixClientPeg.get()._crypto);
|
event.attemptDecryption(MatrixClientPeg.get()._crypto);
|
||||||
|
Loading…
Reference in New Issue
Block a user