add fixmes

This commit is contained in:
Matthew Hodgson 2016-09-07 16:09:44 +01:00
parent 990d84df77
commit 8f75bce29e

View file

@ -44,7 +44,12 @@ var FilePanel = React.createClass({
componentWillReceiveProps: function(nextProps) { componentWillReceiveProps: function(nextProps) {
if (nextProps.roomId !== this.props.roomId) { if (nextProps.roomId !== this.props.roomId) {
// otherwise we race between updating the TimelinePanel and determining the new timelineSet // otherwise we race between re-rendering the TimelinePanel and setting the new timelineSet.
//
// FIXME: this race only happens because of the promise returned by getOrCreateFilter().
// We should only need to create the containsUrl filter once per login session, so in practice
// it shouldn't be being done here at all. Then we could just update the timelineSet directly
// without resetting it first, and speed up room-change.
this.setState({ timelineSet: null }); this.setState({ timelineSet: null });
this.updateTimelineSet(nextProps.roomId); this.updateTimelineSet(nextProps.roomId);
} }
@ -66,6 +71,7 @@ var FilePanel = React.createClass({
} }
); );
// FIXME: we shouldn't be doing this every time we change room - see comment above.
client.getOrCreateFilter("FILTER_FILES_" + client.credentials.userId, filter).then( client.getOrCreateFilter("FILTER_FILES_" + client.credentials.userId, filter).then(
(filterId)=>{ (filterId)=>{
filter.filterId = filterId; filter.filterId = filterId;