Refresh claims fix #246

Merged
6ea86b96 merged 2 commits from refresh-claims-fix into master 2017-06-16 23:19:53 +02:00
6 changed files with 4 additions and 35 deletions

View file

@ -44,16 +44,6 @@ export function doResolveUri(uri) {
}; };
} }
export function doCancelResolveUri(uri) {
return function(dispatch, getState) {
lbry.cancelResolve({ uri });
dispatch({
type: types.RESOLVE_URI_CANCELED,
data: { uri },
});
};
}
export function doFetchFeaturedUris() { export function doFetchFeaturedUris() {
return function(dispatch, getState) { return function(dispatch, getState) {
const state = getState(); const state = getState();

View file

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { doNavigate } from "actions/app"; import { doNavigate } from "actions/app";
import { doResolveUri, doCancelResolveUri } from "actions/content"; import { doResolveUri } from "actions/content";
import { selectObscureNsfw } from "selectors/app"; import { selectObscureNsfw } from "selectors/app";
import { import {
makeSelectClaimForUri, makeSelectClaimForUri,
@ -31,7 +31,6 @@ const makeSelect = () => {
const perform = dispatch => ({ const perform = dispatch => ({
navigate: (path, params) => dispatch(doNavigate(path, params)), navigate: (path, params) => dispatch(doNavigate(path, params)),
resolveUri: uri => dispatch(doResolveUri(uri)), resolveUri: uri => dispatch(doResolveUri(uri)),
cancelResolveUri: uri => dispatch(doCancelResolveUri(uri)),
}); });
export default connect(makeSelect, perform)(FileCard); export default connect(makeSelect, perform)(FileCard);

View file

@ -23,14 +23,6 @@ class FileCard extends React.PureComponent {
} }
} }
componentWillUnmount() {
const { isResolvingUri, cancelResolveUri, uri } = this.props;
if (isResolvingUri) {
cancelResolveUri(uri);
}
}
handleMouseOver() { handleMouseOver() {
this.setState({ this.setState({
hovered: true, hovered: true,
@ -47,13 +39,11 @@ class FileCard extends React.PureComponent {
const { claim, fileInfo, metadata, isResolvingUri, navigate } = this.props; const { claim, fileInfo, metadata, isResolvingUri, navigate } = this.props;
const uri = lbryuri.normalize(this.props.uri); const uri = lbryuri.normalize(this.props.uri);
const title = !isResolvingUri && metadata && metadata.title const title = metadata && metadata.title ? metadata.title : uri;
? metadata.title
: uri;
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw; const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
let description = ""; let description = "";
if (isResolvingUri) { if (isResolvingUri && !claim) {
description = __("Loading..."); description = __("Loading...");
} else if (metadata && metadata.description) { } else if (metadata && metadata.description) {
description = metadata.description; description = metadata.description;

View file

@ -21,7 +21,7 @@ class UriIndicator extends React.PureComponent {
render() { render() {
const { claim, uri, isResolvingUri } = this.props; const { claim, uri, isResolvingUri } = this.props;
if (isResolvingUri) { if (isResolvingUri && !claim) {
return <span className="empty">Validating...</span>; return <span className="empty">Validating...</span>;
} }

View file

@ -39,7 +39,6 @@ export const FETCH_FEATURED_CONTENT_COMPLETED =
"FETCH_FEATURED_CONTENT_COMPLETED"; "FETCH_FEATURED_CONTENT_COMPLETED";
export const RESOLVE_URI_STARTED = "RESOLVE_URI_STARTED"; export const RESOLVE_URI_STARTED = "RESOLVE_URI_STARTED";
export const RESOLVE_URI_COMPLETED = "RESOLVE_URI_COMPLETED"; export const RESOLVE_URI_COMPLETED = "RESOLVE_URI_COMPLETED";
export const RESOLVE_URI_CANCELED = "RESOLVE_URI_CANCELED";
export const FETCH_CHANNEL_CLAIMS_STARTED = "FETCH_CHANNEL_CLAIMS_STARTED"; export const FETCH_CHANNEL_CLAIMS_STARTED = "FETCH_CHANNEL_CLAIMS_STARTED";
export const FETCH_CHANNEL_CLAIMS_COMPLETED = "FETCH_CHANNEL_CLAIMS_COMPLETED"; export const FETCH_CHANNEL_CLAIMS_COMPLETED = "FETCH_CHANNEL_CLAIMS_COMPLETED";
export const FETCH_CLAIM_LIST_MINE_STARTED = "FETCH_CLAIM_LIST_MINE_STARTED"; export const FETCH_CLAIM_LIST_MINE_STARTED = "FETCH_CLAIM_LIST_MINE_STARTED";

View file

@ -26,15 +26,6 @@ reducers[types.RESOLVE_URI_COMPLETED] = function(state, action) {
}); });
}; };
reducers[types.RESOLVE_URI_CANCELED] = function(state, action) {
const uri = action.data.uri;
const newClaims = Object.assign({}, state.claimsByUri);
delete newClaims[uri];
return Object.assign({}, state, {
claimsByUri: newClaims,
});
};
reducers[types.FETCH_CLAIM_LIST_MINE_STARTED] = function(state, action) { reducers[types.FETCH_CLAIM_LIST_MINE_STARTED] = function(state, action) {
return Object.assign({}, state, { return Object.assign({}, state, {
isClaimListMinePending: true, isClaimListMinePending: true,