@@ -16,13 +16,14 @@ 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" ;
1920import { ActionPayload } from "../dispatcher/payloads" ;
2021import { AsyncStoreWithClient } from "./AsyncStoreWithClient" ;
2122import defaultDispatcher from "../dispatcher/dispatcher" ;
2223import { arrayHasDiff } from "../utils/arrays" ;
2324import { isNullOrUndefined } from "matrix-js-sdk/src/utils" ;
2425import { SettingLevel } from "../settings/SettingLevel" ;
25- import { MatrixClientPeg } from '../MatrixClientPeg' ;
26+ import { MatrixClientPeg } from '../MatrixClientPeg' ;
2627
2728const MAX_ROOMS = 20 ; // arbitrary
2829const AUTOJOIN_WAIT_THRESHOLD_MS = 90000 ; // 90s, the time we wait for an autojoined room to show up
@@ -64,21 +65,18 @@ export class BreadcrumbsStore extends AsyncStoreWithClient<IState> {
6465 const prevRoomCount = ( prevState . rooms ?. length || 0 ) ;
6566 const currentRoomCount = ( this . state . rooms ?. length || 0 )
6667
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- */
68+ // Only decrypting the breadcrumb rooms events on app initialisation
69+ // when room count transitions from 0 to the number of rooms it contains
7170 if ( prevRoomCount === 0 && currentRoomCount > prevRoomCount ) {
7271 const client = MatrixClientPeg . get ( ) ;
73- /**
74- * Rooms in the breadcrumb have a good chance to be interacted with
75- * again by a user. Decrypting the messages ahead of time will help
76- * reduce content shift on first render
77- */
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
7875 this . state . rooms ?. forEach ( async room => {
79- const [ cryptoEvent ] = room . currentState . getStateEvents ( "m.room.encryption" ) ;
76+ const [ cryptoEvent ] = room . currentState . getStateEvents ( EventType . RoomEncryption ) ;
8077 if ( cryptoEvent ) {
8178 if ( ! client . isRoomEncrypted ( room . roomId ) ) {
79+ // XXX: Private member access
8280 await client . _crypto . onCryptoEvent ( cryptoEvent ) ;
8381 }
8482 room ?. decryptAllEvents ( ) ;
0 commit comments