Remove doCancelResolveUri, it deletes claims from the store
This commit is contained in:
parent
5074b368ee
commit
5595b5b5b2
5 changed files with 1 additions and 30 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() {
|
export function doFetchFeaturedUris() {
|
||||||
return function(dispatch, getState) {
|
return function(dispatch, getState) {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue