@@ -16,14 +16,12 @@ limitations under the License.
1616
1717import SettingsStore from "../settings/SettingsStore" ;
1818import { Room } from "matrix-js-sdk/src/models/room" ;
19- import { EventType } from "matrix-js-sdk/src/@types/event" ;
2019import { ActionPayload } from "../dispatcher/payloads" ;
2120import { AsyncStoreWithClient } from "./AsyncStoreWithClient" ;
2221import defaultDispatcher from "../dispatcher/dispatcher" ;
2322import { arrayHasDiff } from "../utils/arrays" ;
2423import { isNullOrUndefined } from "matrix-js-sdk/src/utils" ;
2524import { SettingLevel } from "../settings/SettingLevel" ;
26- import { MatrixClientPeg } from '../MatrixClientPeg' ;
2725
2826const MAX_ROOMS = 20 ; // arbitrary
2927const AUTOJOIN_WAIT_THRESHOLD_MS = 90000 ; // 90s, the time we wait for an autojoined room to show up
@@ -61,30 +59,6 @@ export class BreadcrumbsStore extends AsyncStoreWithClient<IState> {
6159 return this . matrixClient && this . matrixClient . getVisibleRooms ( ) . length >= 20 ;
6260 }
6361
64- componentDidUpdate ( prevProps , prevState ) {
65- const prevRoomCount = ( prevState . rooms ?. length || 0 ) ;
66- const currentRoomCount = ( this . state . rooms ?. length || 0 )
67-
68- // Only decrypting the breadcrumb rooms events on app initialisation
69- // when room count transitions from 0 to the number of rooms it contains
70- if ( prevRoomCount === 0 && currentRoomCount > prevRoomCount ) {
71- const client = MatrixClientPeg . get ( ) ;
72- // Rooms in the breadcrumb have a good chance to be interacted with
73- // again by a user. Decrypting the messages ahead of time will help
74- // reduce content shift on first render
75- this . state . rooms ?. forEach ( async room => {
76- const [ cryptoEvent ] = room . currentState . getStateEvents ( EventType . RoomEncryption ) ;
77- if ( cryptoEvent ) {
78- if ( ! client . isRoomEncrypted ( room . roomId ) ) {
79- // XXX: Private member access
80- await client . _crypto . onCryptoEvent ( cryptoEvent ) ;
81- }
82- room ?. decryptAllEvents ( ) ;
83- }
84- } ) ;
85- }
86- }
87-
8862 protected async onAction ( payload : ActionPayload ) {
8963 if ( ! this . matrixClient ) return ;
9064
0 commit comments