From cc1963d21e7debf45e7ce3d20f5348d18577c2f6 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Tue, 10 Oct 2017 09:02:18 -0400 Subject: [PATCH] restore resolve dispatch behavior on file cards and tiles --- ui/js/component/fileCard/view.jsx | 14 ++++++++++---- ui/js/component/fileTile/view.jsx | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ui/js/component/fileCard/view.jsx b/ui/js/component/fileCard/view.jsx index 9fc8bfd1a..3ff093ef0 100644 --- a/ui/js/component/fileCard/view.jsx +++ b/ui/js/component/fileCard/view.jsx @@ -20,13 +20,19 @@ class FileCard extends React.PureComponent { } componentWillMount() { - const { uri, resolveUri } = this.props; - resolveUri(uri); + this.resolve(this.props); } componentWillReceiveProps(nextProps) { - const { uri, resolveUri } = nextProps; - resolveUri(uri); + this.resolve(nextProps); + } + + resolve(props) { + const { isResolvingUri, resolveUri, claim, uri } = props; + + if (!isResolvingUri && claim === undefined && uri) { + resolveUri(uri); + } } handleMouseOver() { diff --git a/ui/js/component/fileTile/view.jsx b/ui/js/component/fileTile/view.jsx index daa7a011d..b243ea1d6 100644 --- a/ui/js/component/fileTile/view.jsx +++ b/ui/js/component/fileTile/view.jsx @@ -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() {