FilePanel: Use the event index in encrypted rooms to populate the panel.
This commit is contained in:
parent
8a17c73b79
commit
a1cbff3c8c
1 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,7 @@ import PropTypes from 'prop-types';
|
||||||
import Matrix from 'matrix-js-sdk';
|
import Matrix from 'matrix-js-sdk';
|
||||||
import * as sdk from '../../index';
|
import * as sdk from '../../index';
|
||||||
import {MatrixClientPeg} from '../../MatrixClientPeg';
|
import {MatrixClientPeg} from '../../MatrixClientPeg';
|
||||||
|
import {EventIndexPeg} from "../../indexing/EventIndexPeg";
|
||||||
import { _t } from '../../languageHandler';
|
import { _t } from '../../languageHandler';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -73,12 +74,20 @@ const FilePanel = createReactClass({
|
||||||
async updateTimelineSet(roomId: string) {
|
async updateTimelineSet(roomId: string) {
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const room = client.getRoom(roomId);
|
const room = client.getRoom(roomId);
|
||||||
|
const eventIndex = EventIndexPeg.get();
|
||||||
|
|
||||||
this.noRoom = !room;
|
this.noRoom = !room;
|
||||||
|
|
||||||
if (room) {
|
if (room) {
|
||||||
|
let timelineSet;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let timelineSet = await this.fetchFileEventsServer(room)
|
timelineSet = await this.fetchFileEventsServer(room)
|
||||||
|
|
||||||
|
if (client.isRoomEncrypted(roomId) && eventIndex !== null) {
|
||||||
|
await eventIndex.populateFileTimeline(room, timelineSet);
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({ timelineSet: timelineSet });
|
this.setState({ timelineSet: timelineSet });
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in a new issue