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,13 +20,19 @@ class FileCard extends React.PureComponent {
} }
componentWillMount() { componentWillMount() {
const { uri, resolveUri } = this.props; this.resolve(this.props);
resolveUri(uri);
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { uri, resolveUri } = nextProps; this.resolve(nextProps);
resolveUri(uri); }
resolve(props) {
const { isResolvingUri, resolveUri, claim, uri } = props;
if (!isResolvingUri && claim === undefined && uri) {
resolveUri(uri);
}
} }
handleMouseOver() { handleMouseOver() {

View file

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