Skip to content

Commit

Permalink
Merge pull request #1858 from Giveth/1857_remove_donation_being_proce…
Browse files Browse the repository at this point in the history
…ssed_toast_when_tx_is_mined

remove donation being processed toast when tx is mined
  • Loading branch information
MohammadPCh committed Nov 28, 2022
2 parents b531ab7 + a79af75 commit 0acad16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.5.1",
"version": "2.5.2",
"private": true,
"scripts": {
"build": "next build",
Expand Down
16 changes: 6 additions & 10 deletions src/components/modals/DonateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ const DonateModal = (props: IDonateModalProps) => {
const dispatch = useAppDispatch();
const { isAnimating, closeModal } = useModalAnimation(setShowModal);
const isDonatingToGiveth = donationToGiveth > 0;

const { formatMessage } = useIntl();

const [donating, setDonating] = useState(false);
const [firstDonationSaved, setFirstDonationSaved] = useState(false);
const [secondDonationSaved, setSecondDonationSaved] = useState(false);
const [firstTxHash, setFirstTxHash] = useState('');
const [secondTxHash, setSecondTxHash] = useState('');
const [isFirstTxSuccess, setIsFirstTxSuccess] = useState(false);
const [secondTxStatus, setSecondTxStatus] = useState<EToastType>();
const [processFinished, setProcessFinished] = useState(false);
const [failedModalType, setFailedModalType] =
useState<EDonationFailedType>();

Expand Down Expand Up @@ -111,6 +112,8 @@ const DonateModal = (props: IDonateModalProps) => {
};

const delayedCloseModal = (txHash1: string, txHash2?: string) => {
setProcessFinished(true);
setDonating(false);
const txHash = txHash2 ? [txHash1, txHash2] : [txHash1];
setTimeout(() => {
closeModal();
Expand Down Expand Up @@ -278,7 +281,7 @@ const DonateModal = (props: IDonateModalProps) => {
)}
</DonatingBox>
<Buttons>
{firstDonationSaved && (
{firstDonationSaved && !processFinished && (
<InlineToast
type={EToastType.Info}
message={formatMessage({
Expand All @@ -289,7 +292,7 @@ const DonateModal = (props: IDonateModalProps) => {
<DonateButton
loading={donating}
buttonType='primary'
disabled={donating}
disabled={donating || processFinished}
label={
donating
? formatMessage({ id: 'label.donating' })
Expand Down Expand Up @@ -375,11 +378,4 @@ const Buttons = styled.div`
}
`;

const CloseButton = styled(Button)`
margin: 5px 0 0 0;
:hover {
background: transparent;
}
`;

export default DonateModal;

1 comment on commit 0acad16

@vercel
Copy link

@vercel vercel bot commented on 0acad16 Nov 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

giveth-dapps-v2 – ./

giveth-dapps-v2-givethio.vercel.app
www.giveth.io
giveth.io
giveth-dapps-v2-git-main-givethio.vercel.app

Please sign in to comment.