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 { 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 WalletSendTip from './view';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
import { doOpenModal } from 'redux/actions/app';
|
||||||
import { withRouter } from 'react-router';
|
import { withRouter } from 'react-router';
|
||||||
|
@ -13,6 +19,7 @@ const select = (state, props) => ({
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||||
|
sendSupport: (amount, claimId, isSupport) => dispatch(doSendTip(amount, claimId, isSupport)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default withRouter(connect(select, perform)(WalletSendTip));
|
export default withRouter(connect(select, perform)(WalletSendTip));
|
||||||
|
|
|
@ -30,10 +30,15 @@ function WalletSendTip(props: Props) {
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
|
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
const { openModal } = props;
|
const { openModal, sendSupport } = props;
|
||||||
|
|
||||||
if (tipAmount && claimId) {
|
if (tipAmount && claimId) {
|
||||||
const modalProps = { tipAmount, claimId, title, isSupport };
|
if (isSupport) {
|
||||||
openModal(MODALS.CONFIRM_SEND_TIP, modalProps);
|
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>
|
</I18nMessage>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
actions={
|
actions={<SendTip uri={uri} claimIsMine={claimIsMine} isSupport={isSupport} onCancel={closeModal} />}
|
||||||
<SendTip
|
|
||||||
uri={uri}
|
|
||||||
claimIsMine={claimIsMine}
|
|
||||||
isSupport={isSupport}
|
|
||||||
onCancel={closeModal}
|
|
||||||
sendTipCallback={closeModal}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue