Refresh claims fix #246
6 changed files with 4 additions and 35 deletions
|
@ -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() {
|
||||
return function(dispatch, getState) {
|
||||
const state = getState();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { doNavigate } from "actions/app";
|
||||
import { doResolveUri, doCancelResolveUri } from "actions/content";
|
||||
import { doResolveUri } from "actions/content";
|
||||
import { selectObscureNsfw } from "selectors/app";
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
|
@ -31,7 +31,6 @@ const makeSelect = () => {
|
|||
const perform = dispatch => ({
|
||||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
cancelResolveUri: uri => dispatch(doCancelResolveUri(uri)),
|
||||
});
|
||||
|
||||
export default connect(makeSelect, perform)(FileCard);
|
||||
|
|
|
@ -23,14 +23,6 @@ class FileCard extends React.PureComponent {
|
|||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
const { isResolvingUri, cancelResolveUri, uri } = this.props;
|
||||
|
||||
if (isResolvingUri) {
|
||||
cancelResolveUri(uri);
|
||||
}
|
||||
}
|
||||
|
||||
handleMouseOver() {
|
||||
this.setState({
|
||||
hovered: true,
|
||||
|
@ -47,13 +39,11 @@ class FileCard extends React.PureComponent {
|
|||
const { claim, fileInfo, metadata, isResolvingUri, navigate } = this.props;
|
||||
|
||||
const uri = lbryuri.normalize(this.props.uri);
|
||||
const title = !isResolvingUri && metadata && metadata.title
|
||||
? metadata.title
|
||||
: uri;
|
||||
const title = metadata && metadata.title ? metadata.title : uri;
|
||||
const obscureNsfw = this.props.obscureNsfw && metadata && metadata.nsfw;
|
||||
|
||||
let description = "";
|
||||
if (isResolvingUri) {
|
||||
if (isResolvingUri && !claim) {
|
||||
description = __("Loading...");
|
||||
} else if (metadata && metadata.description) {
|
||||
description = metadata.description;
|
||||
|
|
|
@ -21,7 +21,7 @@ class UriIndicator extends React.PureComponent {
|
|||
render() {
|
||||
const { claim, uri, isResolvingUri } = this.props;
|
||||
|
||||
if (isResolvingUri) {
|
||||
if (isResolvingUri && !claim) {
|
||||
return <span className="empty">Validating...</span>;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ export const FETCH_FEATURED_CONTENT_COMPLETED =
|
|||
"FETCH_FEATURED_CONTENT_COMPLETED";
|
||||
export const RESOLVE_URI_STARTED = "RESOLVE_URI_STARTED";
|
||||
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_COMPLETED = "FETCH_CHANNEL_CLAIMS_COMPLETED";
|
||||
export const FETCH_CLAIM_LIST_MINE_STARTED = "FETCH_CLAIM_LIST_MINE_STARTED";
|
||||
|
|
|
@ -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) {
|
||||
return Object.assign({}, state, {
|
||||
isClaimListMinePending: true,
|
||||
|
|
Loading…
Reference in a new issue