Second batch: Replace MatrixClient.isRoomEncrypted by MatrixClient.CryptoApi.isEncryptionEnabledInRoom (#28466)
* Add `asyncFilter` * Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `MemberListStore.tsx` * Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `EventIndex.tsx` * Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `SendMessageComposer.tsx` * Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `ScalarMessaging.ts` * Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `RolesRoomSettingsTab.tsx` * Add reject doc to `asyncFilter` * Reverse `MemberListStore.loadMembers` condition * Remove async for `ScalarMessaging.ts` * Display permission section only after `isEncrypted` is computed * Display composer only after `isEncrypted` is computed * Revert "Display composer only after `isEncrypted` is computed" This reverts commit4d4e037391. * Revert "Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `SendMessageComposer.tsx`" This reverts commit6bf06da02c.
This commit is contained in:
@@ -70,7 +70,7 @@ export class MemberListStore {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!this.isLazyLoadingEnabled(roomId) || this.loadedRooms.has(roomId)) {
|
||||
if (this.loadedRooms.has(roomId) || !(await this.isLazyLoadingEnabled(roomId))) {
|
||||
// nice and easy, we must already have all the members so just return them.
|
||||
return this.loadMembersInRoom(room);
|
||||
}
|
||||
@@ -121,10 +121,10 @@ export class MemberListStore {
|
||||
* @param roomId The room to check if lazy loading is enabled
|
||||
* @returns True if enabled
|
||||
*/
|
||||
private isLazyLoadingEnabled(roomId: string): boolean {
|
||||
private async isLazyLoadingEnabled(roomId: string): Promise<boolean> {
|
||||
if (SettingsStore.getValue("feature_sliding_sync")) {
|
||||
// only unencrypted rooms use lazy loading
|
||||
return !this.stores.client!.isRoomEncrypted(roomId);
|
||||
return !(await this.stores.client?.getCrypto()?.isEncryptionEnabledInRoom(roomId));
|
||||
}
|
||||
return this.stores.client!.hasLazyLoadMembersEnabled();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user