diff --git a/ui/js/actions/claims.js b/ui/js/actions/claims.js index 71f94852c..e8e45f341 100644 --- a/ui/js/actions/claims.js +++ b/ui/js/actions/claims.js @@ -4,6 +4,14 @@ import { doOpenModal, doShowSnackBar } from "actions/app"; import * as types from "constants/action_types"; import * as modals from "constants/modal_types"; +export function doShowTipBox() { + return { type: types.SHOW_TIP_BOX }; +} + +export function doHideTipBox() { + return { type: types.HIDE_TIP_BOX }; +} + export function doSendSupport(amount, claim_id) { return function(dispatch, getState) { const state = getState(); @@ -22,6 +30,7 @@ export function doSendSupport(amount, claim_id) { dispatch({ type: types.SUPPORT_TRANSACTION_COMPLETED, }); + dispatch(doHideTipBox); dispatch( doShowSnackBar({ message: __(`You sent ${amount} LBC as support, Mahalo!`), @@ -32,7 +41,7 @@ export function doSendSupport(amount, claim_id) { } else { dispatch({ type: types.SUPPORT_TRANSACTION_FAILED, - data: { error: results }, + data: { error: results.code }, }); dispatch(doOpenModal(modals.TRANSACTION_FAILED)); } @@ -41,7 +50,7 @@ export function doSendSupport(amount, claim_id) { const errorCallback = error => { dispatch({ type: types.SUPPORT_TRANSACTION_FAILED, - data: { error: error.message }, + data: { error: error.code }, }); dispatch(doOpenModal(modals.TRANSACTION_FAILED)); }; diff --git a/ui/js/component/fileActions/index.js b/ui/js/component/fileActions/index.js index b94e2bbcb..851b28507 100644 --- a/ui/js/component/fileActions/index.js +++ b/ui/js/component/fileActions/index.js @@ -9,6 +9,7 @@ import { doOpenFileInShell, doOpenFileInFolder } from "actions/file_info"; import { makeSelectClaimIsMine } from "selectors/claims"; import { doPurchaseUri, doLoadVideo, doStartDownload } from "actions/content"; import { doNavigate } from "actions/navigation"; +import { doShowTipBox } from "actions/claims"; import FileActions from "./view"; const select = (state, props) => ({ @@ -25,6 +26,7 @@ const perform = dispatch => ({ startDownload: uri => dispatch(doPurchaseUri(uri)), restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)), editClaim: claimId => dispatch(doNavigate("/publish", { id: claimId })), + showTipBox: () => dispatch(doShowTipBox()), }); export default connect(select, perform)(FileActions); diff --git a/ui/js/component/fileActions/view.jsx b/ui/js/component/fileActions/view.jsx index 361338b89..bffcfa664 100644 --- a/ui/js/component/fileActions/view.jsx +++ b/ui/js/component/fileActions/view.jsx @@ -4,10 +4,6 @@ import FileDownloadLink from "component/fileDownloadLink"; import * as modals from "constants/modal_types"; class FileActions extends React.PureComponent { - handleSupportButtonClicked() { - this.props.onTipShow(); - } - render() { const { fileInfo, @@ -37,7 +33,7 @@ class FileActions extends React.PureComponent { button="text" icon="icon-gift" label={__("Support")} - onClick={this.handleSupportButtonClicked.bind(this)} + onClick={this.props.showTipBox} /> ({}); const perform = dispatch => ({ sendSupport: (amount, claim_id) => dispatch(doSendSupport(amount, claim_id)), + hideTipBox: () => dispatch(doHideTipBox()), }); export default connect(select, perform)(TipLink); diff --git a/ui/js/component/tipLink/view.jsx b/ui/js/component/tipLink/view.jsx index 831806d48..00c2639f3 100644 --- a/ui/js/component/tipLink/view.jsx +++ b/ui/js/component/tipLink/view.jsx @@ -7,7 +7,7 @@ class TipLink extends React.PureComponent { super(props); this.state = { - tipAmount: 1.0, + tipAmount: 0.0, }; } @@ -15,11 +15,10 @@ class TipLink extends React.PureComponent { let claim_id = this.props.claim_id; let amount = this.state.tipAmount; this.props.sendSupport(amount, claim_id); - this.props.onTipHide(); } handleSupportCancelButtonClicked() { - this.props.onTipHide(); + this.props.hideTipBox(); } handleSupportPriceChange(event) { diff --git a/ui/js/component/transactionList/internal/TransactionListBody.jsx b/ui/js/component/transactionList/internal/TransactionListBody.jsx index 12beb2e8d..6ad795f05 100644 --- a/ui/js/component/transactionList/internal/TransactionListBody.jsx +++ b/ui/js/component/transactionList/internal/TransactionListBody.jsx @@ -125,13 +125,26 @@ class TransactionTableBody extends React.PureComponent { render() { const { transactions, filter } = this.props; + let transactionList = transactions + .filter(this.filterList, this) + .filter(this.removeFeeTx, this) + .map(this.renderBody, this); + + if (transactionList.length == 0) { + return ( +
+