fix featured search result item stuck loading
This commit is contained in:
parent
095bc9ed0a
commit
1dc85cc4c9
1 changed files with 6 additions and 2 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue