fix featured search result item stuck loading

This commit is contained in:
Akinwale Ariwodola 2019-09-06 19:41:15 +01:00
parent 095bc9ed0a
commit 1dc85cc4c9

View file

@ -13,6 +13,10 @@ import ProgressBar from 'component/progressBar';
import fileListStyle from 'styles/fileList';
class FileListItem extends React.PureComponent {
state = {
url: null,
};
getStorageForFileInfo = fileInfo => {
if (!fileInfo.completed) {
const written = formatBytes(fileInfo.written_bytes);
@ -44,8 +48,8 @@ class FileListItem extends React.PureComponent {
componentDidUpdate() {
const { claim, resolveUri, uri } = this.props;
if (!claim) {
resolveUri(uri);
if (!claim && uri !== this.state.url) {
this.setState({ url: uri }, () => resolveUri(uri));
}
}