Do not double confirm on supports, per code review
This commit is contained in:
parent
85a8234115
commit
cb470ad970
3 changed files with 17 additions and 13 deletions
|
@ -1,5 +1,11 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { makeSelectTitleForUri, makeSelectClaimForUri, selectIsSendingSupport, selectBalance } from 'lbry-redux';
|
||||
import {
|
||||
doSendTip,
|
||||
makeSelectTitleForUri,
|
||||
makeSelectClaimForUri,
|
||||
selectIsSendingSupport,
|
||||
selectBalance,
|
||||
} from 'lbry-redux';
|
||||
import WalletSendTip from './view';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { withRouter } from 'react-router';
|
||||
|
@ -13,6 +19,7 @@ const select = (state, props) => ({
|
|||
|
||||
const perform = dispatch => ({
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
sendSupport: (amount, claimId, isSupport) => dispatch(doSendTip(amount, claimId, isSupport)),
|
||||
});
|
||||
|
||||
export default withRouter(connect(select, perform)(WalletSendTip));
|
||||
|
|
|
@ -30,10 +30,15 @@ function WalletSendTip(props: Props) {
|
|||
const isMobile = useIsMobile();
|
||||
|
||||
function handleSubmit() {
|
||||
const { openModal } = props;
|
||||
const { openModal, sendSupport } = props;
|
||||
|
||||
if (tipAmount && claimId) {
|
||||
const modalProps = { tipAmount, claimId, title, isSupport };
|
||||
openModal(MODALS.CONFIRM_SEND_TIP, modalProps);
|
||||
if (isSupport) {
|
||||
sendSupport(tipAmount, claimId, isSupport);
|
||||
} else {
|
||||
const modalProps = { tipAmount, claimId, title, isSupport };
|
||||
openModal(MODALS.CONFIRM_SEND_TIP, modalProps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,15 +33,7 @@ class ModalSendTip extends React.PureComponent<Props> {
|
|||
</I18nMessage>
|
||||
)
|
||||
}
|
||||
actions={
|
||||
<SendTip
|
||||
uri={uri}
|
||||
claimIsMine={claimIsMine}
|
||||
isSupport={isSupport}
|
||||
onCancel={closeModal}
|
||||
sendTipCallback={closeModal}
|
||||
/>
|
||||
}
|
||||
actions={<SendTip uri={uri} claimIsMine={claimIsMine} isSupport={isSupport} onCancel={closeModal} />}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue