From 0738d186a50bb84d2c2dc6dbf3e6d6e2972b6d18 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Wed, 29 Apr 2020 18:02:53 -0400 Subject: [PATCH] close modal after sending support --- ui/component/walletSendTip/index.js | 3 ++- ui/component/walletSendTip/view.jsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/component/walletSendTip/index.js b/ui/component/walletSendTip/index.js index 4fe81d18e..691370c2f 100644 --- a/ui/component/walletSendTip/index.js +++ b/ui/component/walletSendTip/index.js @@ -8,7 +8,7 @@ import { SETTINGS, } from 'lbry-redux'; import WalletSendTip from './view'; -import { doOpenModal } from 'redux/actions/app'; +import { doOpenModal, doHideModal } from 'redux/actions/app'; import { withRouter } from 'react-router'; import { makeSelectClientSetting } from 'redux/selectors/settings'; @@ -23,6 +23,7 @@ const select = (state, props) => ({ const perform = dispatch => ({ openModal: (modal, props) => dispatch(doOpenModal(modal, props)), + closeModal: () => dispatch(doHideModal()), sendSupport: (amount, claimId, isSupport) => dispatch(doSendTip(amount, claimId, isSupport)), }); diff --git a/ui/component/walletSendTip/view.jsx b/ui/component/walletSendTip/view.jsx index 600b3cf1c..47468fe61 100644 --- a/ui/component/walletSendTip/view.jsx +++ b/ui/component/walletSendTip/view.jsx @@ -17,7 +17,7 @@ type Props = { isPending: boolean, sendSupport: (number, string, boolean) => void, onCancel: () => void, - sendTipCallback?: () => void, + closeModal: () => void, balance: number, isSupport: boolean, openModal: (id: string, { tipAmount: number, claimId: string, isSupport: boolean }) => void, @@ -38,6 +38,7 @@ function WalletSendTip(props: Props) { instantTipMax, openModal, sendSupport, + closeModal, } = props; const [tipAmount, setTipAmount] = React.useState(0); const [tipError, setTipError] = React.useState(); @@ -50,6 +51,7 @@ function WalletSendTip(props: Props) { openModal(MODALS.CONFIRM_SEND_TIP, modalProps); } else { sendSupport(tipAmount, claimId, isSupport); + closeModal(); } }