Fix destructuring when threads has no server support (#7976)

This commit is contained in:
Germain 2022-03-04 11:10:45 +00:00 committed by GitHub
parent 86329012f3
commit 84bd136657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,8 +186,10 @@ export default class ThreadView extends React.Component<IProps, IState> {
}, async () => {
thread.emit(ThreadEvent.ViewThread);
if (!thread.initialEventsFetched) {
const { nextBatch } = await thread.fetchInitialEvents();
this.nextBatch = nextBatch;
const response = await thread.fetchInitialEvents();
if (response?.nextBatch) {
this.nextBatch = response.nextBatch;
}
}
this.timelinePanel.current?.refreshTimeline();