This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree 1 file changed +5
-10
lines changed
src/components/structures
1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ import dis from "../../dispatcher/dispatcher";
54
54
import { Action } from "../../dispatcher/actions" ;
55
55
import Timer from "../../utils/Timer" ;
56
56
import shouldHideEvent from "../../shouldHideEvent" ;
57
- import { arrayFastClone } from "../../utils/arrays" ;
58
57
import MessagePanel from "./MessagePanel" ;
59
58
import { IScrollState } from "./ScrollPanel" ;
60
59
import { ActionPayload } from "../../dispatcher/payloads" ;
@@ -1754,15 +1753,11 @@ class TimelinePanel extends React.Component<IProps, IState> {
1754
1753
[ ...mainEvents ] ,
1755
1754
) ;
1756
1755
1757
- // `arrayFastClone` performs a shallow copy of the array
1758
- // we want the last event to be decrypted first but displayed last
1759
- // `reverse` is destructive and unfortunately mutates the "events" array
1760
- arrayFastClone ( events )
1761
- . reverse ( )
1762
- . forEach ( ( event ) => {
1763
- const client = MatrixClientPeg . safeGet ( ) ;
1764
- client . decryptEventIfNeeded ( event ) ;
1765
- } ) ;
1756
+ // We want the last event to be decrypted first
1757
+ const client = MatrixClientPeg . safeGet ( ) ;
1758
+ for ( let i = events . length - 1 ; i >= 0 ; -- i ) {
1759
+ client . decryptEventIfNeeded ( events [ i ] ) ;
1760
+ }
1766
1761
1767
1762
const firstVisibleEventIndex = this . checkForPreJoinUISI ( events ) ;
1768
1763
You can’t perform that action at this time.
0 commit comments