This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/components/structures Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import {haveTileForEvent} from "../views/rooms/EventTile";
3838import { UIFeature } from "../../settings/UIFeature" ;
3939import { objectHasDiff } from "../../utils/objects" ;
4040import { replaceableComponent } from "../../utils/replaceableComponent" ;
41+ import { arrayFastClone } from "../../utils/arrays" ;
4142
4243const PAGINATE_SIZE = 20 ;
4344const INITIAL_SIZE = 20 ;
@@ -1142,11 +1143,11 @@ class TimelinePanel extends React.Component {
11421143 _getEvents ( ) {
11431144 const events = this . _timelineWindow . getEvents ( ) ;
11441145
1145- // `slice ` performs a shallow copy of the array
1146+ // `arrayFastClone ` performs a shallow copy of the array
11461147 // we want the last event to be decrypted first but displayed last
11471148 // `reverse` is destructive and unfortunately mutates the "events" array
1148- events
1149- . slice ( ) . reverse ( )
1149+ arrayFastClone ( events )
1150+ . reverse ( )
11501151 . forEach ( event => {
11511152 if ( event . shouldAttemptDecryption ( ) ) {
11521153 event . attemptDecryption ( MatrixClientPeg . get ( ) . _crypto ) ;
You can’t perform that action at this time.
0 commit comments