restore resolve dispatch behavior on file cards and tiles

This commit is contained in:
Jeremy Kauffman 2017-10-10 09:02:18 -04:00
parent c5c67a0de5
commit cc1963d21e
2 changed files with 14 additions and 8 deletions

View file

@ -20,14 +20,20 @@ class FileCard extends React.PureComponent {
}
componentWillMount() {
const { uri, resolveUri } = this.props;
resolveUri(uri);
this.resolve(this.props);
}
componentWillReceiveProps(nextProps) {
const { uri, resolveUri } = nextProps;
this.resolve(nextProps);
}
resolve(props) {
const { isResolvingUri, resolveUri, claim, uri } = props;
if (!isResolvingUri && claim === undefined && uri) {
resolveUri(uri);
}
}
handleMouseOver() {
this.setState({

View file

@ -26,15 +26,15 @@ class FileTile extends React.PureComponent {
}
componentDidMount() {
const { uri, resolveUri } = this.props;
const { isResolvingUri, claim, uri, resolveUri } = this.props;
resolveUri(uri);
if (!isResolvingUri && !claim && uri) resolveUri(uri);
}
componentWillReceiveProps(nextProps) {
const { uri, resolveUri } = this.props;
const { isResolvingUri, claim, uri, resolveUri } = this.props;
resolveUri(uri);
if (!isResolvingUri && claim === undefined && uri) resolveUri(uri);
}
handleMouseOver() {