diff --git a/dist/bundle.es.js b/dist/bundle.es.js index d7554c7..4ef40cc 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1936,13 +1936,13 @@ function doSetDraftTransactionAddress(address) { }; } -function doSendTip(amount, claimId, successCallback, errorCallback) { +function doSendTip(amount, claimId, isSupport, successCallback, errorCallback) { return (dispatch, getState) => { const state = getState(); const balance = selectBalance(state); const myClaims = selectMyClaimsRaw(state); - const isSupport = myClaims.find(claim => claim.claim_id === claimId); + const shouldSupport = isSupport || myClaims.find(claim => claim.claim_id === claimId); if (balance - amount <= 0) { dispatch(doToast({ @@ -1954,7 +1954,7 @@ function doSendTip(amount, claimId, successCallback, errorCallback) { const success = () => { dispatch(doToast({ - message: isSupport ? __(`You deposited ${amount} LBC as a support!`) : __(`You sent ${amount} LBC as a tip, Mahalo!`), + message: shouldSupport ? __(`You deposited ${amount} LBC as a support!`) : __(`You sent ${amount} LBC as a tip, Mahalo!`), linkText: __('History'), linkTarget: __('/wallet') })); @@ -1993,7 +1993,7 @@ function doSendTip(amount, claimId, successCallback, errorCallback) { lbryProxy.support_create({ claim_id: claimId, amount: creditsToString(amount), - tip: isSupport ? false : true + tip: !shouldSupport }).then(success, error); }; } diff --git a/src/redux/actions/wallet.js b/src/redux/actions/wallet.js index 00865bd..475436f 100644 --- a/src/redux/actions/wallet.js +++ b/src/redux/actions/wallet.js @@ -209,13 +209,13 @@ export function doSetDraftTransactionAddress(address) { }; } -export function doSendTip(amount, claimId, successCallback, errorCallback) { +export function doSendTip(amount, claimId, isSupport, successCallback, errorCallback) { return (dispatch, getState) => { const state = getState(); const balance = selectBalance(state); - const myClaims: Array = selectMyClaimsRaw(state); + const myClaims = selectMyClaimsRaw(state); - const isSupport = myClaims.find(claim => claim.claim_id === claimId); + const shouldSupport = isSupport || myClaims.find(claim => claim.claim_id === claimId); if (balance - amount <= 0) { dispatch( @@ -230,7 +230,7 @@ export function doSendTip(amount, claimId, successCallback, errorCallback) { const success = () => { dispatch( doToast({ - message: isSupport + message: shouldSupport ? __(`You deposited ${amount} LBC as a support!`) : __(`You sent ${amount} LBC as a tip, Mahalo!`), linkText: __('History'), @@ -274,7 +274,7 @@ export function doSendTip(amount, claimId, successCallback, errorCallback) { Lbry.support_create({ claim_id: claimId, amount: creditsToString(amount), - tip: isSupport ? false : true, + tip: !shouldSupport, }).then(success, error); }; }