remove loading... spinner on database fetch

This commit is contained in:
or-else
2021-08-16 16:04:32 -07:00
parent 0840a79024
commit b783ec2949
7 changed files with 79 additions and 88 deletions
+6 -4
View File
@@ -372,10 +372,12 @@ class MessagesView extends React.Component {
const topic = this.props.tinode.getTopic(this.state.topic);
if (topic && topic.isSubscribed() && topic.msgHasMoreMessages()) {
newState.fetchingMessages = true;
topic.getMessagesPage(MESSAGES_PAGE).catch((err) => {
this.setState({fetchingMessages: false});
this.props.onError(err.message, 'err');
});
topic.getMessagesPage(MESSAGES_PAGE)
.then(() => this.setState({fetchingMessages: false}))
.catch((err) => {
this.setState({fetchingMessages: false});
this.props.onError(err.message, 'err');
});
}
}
return newState;