Merge pull request #867 from lbryio/abandon-rework

Reworked abandon to not be depenedent on txn list
This commit is contained in:
Liam Cardenas 2017-12-13 13:19:44 -08:00 committed by GitHub
commit 8c371d04da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View file

@ -9,7 +9,7 @@ import {
selectRemoteVersion, selectRemoteVersion,
} from "redux/selectors/app"; } from "redux/selectors/app";
import { doFetchDaemonSettings } from "redux/actions/settings"; import { doFetchDaemonSettings } from "redux/actions/settings";
import { doBalanceSubscribe, doFetchTransactions } from "redux/actions/wallet"; import { doBalanceSubscribe } from "redux/actions/wallet";
import { doAuthenticate } from "redux/actions/user"; import { doAuthenticate } from "redux/actions/user";
import { doFetchFileInfosAndPublishedClaims } from "redux/actions/file_info"; import { doFetchFileInfosAndPublishedClaims } from "redux/actions/file_info";
import * as modals from "constants/modal_types"; import * as modals from "constants/modal_types";
@ -222,7 +222,6 @@ export function doDaemonReady() {
dispatch(doBalanceSubscribe()); dispatch(doBalanceSubscribe());
dispatch(doFetchFileInfosAndPublishedClaims()); dispatch(doFetchFileInfosAndPublishedClaims());
dispatch(doFetchRewardedContent()); dispatch(doFetchRewardedContent());
dispatch(doFetchTransactions(false));
if (!selectIsUpgradeSkipped(state)) { if (!selectIsUpgradeSkipped(state)) {
dispatch(doCheckUpgradeAvailable()); dispatch(doCheckUpgradeAvailable());
} }

View file

@ -4,7 +4,8 @@ import lbry from "lbry";
import lbryio from "lbryio"; import lbryio from "lbryio";
import lbryuri from "lbryuri"; import lbryuri from "lbryuri";
import { makeSelectClientSetting } from "redux/selectors/settings"; import { makeSelectClientSetting } from "redux/selectors/settings";
import { selectBalance, selectTransactionItems } from "redux/selectors/wallet"; import { selectMyClaimsRaw } from "redux/selectors/claims";
import { selectBalance } from "redux/selectors/wallet";
import { import {
makeSelectFileInfoForUri, makeSelectFileInfoForUri,
selectDownloadingByOutpoint, selectDownloadingByOutpoint,
@ -288,7 +289,9 @@ export function doLoadVideo(uri) {
}); });
dispatch( dispatch(
doAlertError( doAlertError(
`Failed to download ${uri}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.` `Failed to download ${
uri
}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.`
) )
); );
}); });
@ -503,8 +506,8 @@ export function doPublish(params) {
export function doAbandonClaim(txid, nout) { export function doAbandonClaim(txid, nout) {
return function(dispatch, getState) { return function(dispatch, getState) {
const state = getState(); const state = getState();
const transactionItems = selectTransactionItems(state); const myClaims = selectMyClaimsRaw(state);
const { claim_id: claimId, claim_name: name } = transactionItems.find( const { claim_id: claimId, name: name } = myClaims.find(
claim => claim.txid == txid && claim.nout == nout claim => claim.txid == txid && claim.nout == nout
); );

View file

@ -29,13 +29,13 @@ export function doBalanceSubscribe() {
}; };
} }
export function doFetchTransactions(fetch_tip_info = true) { export function doFetchTransactions() {
return function(dispatch, getState) { return function(dispatch, getState) {
dispatch({ dispatch({
type: types.FETCH_TRANSACTIONS_STARTED, type: types.FETCH_TRANSACTIONS_STARTED,
}); });
lbry.transaction_list({ include_tip_info: fetch_tip_info }).then(results => { lbry.transaction_list({ include_tip_info: true }).then(results => {
dispatch({ dispatch({
type: types.FETCH_TRANSACTIONS_COMPLETED, type: types.FETCH_TRANSACTIONS_COMPLETED,
data: { data: {