diff --git a/components/ConnectWalletButton.tsx b/components/ConnectWalletButton.tsx
index e3703c7..2b2ed7e 100644
--- a/components/ConnectWalletButton.tsx
+++ b/components/ConnectWalletButton.tsx
@@ -89,7 +89,7 @@ const ConnectWalletButton = (props) => {
{name}
{provider?.url === url ? (
-
+
) : null}
diff --git a/components/ContributionModal.tsx b/components/ContributionModal.tsx
index fe38714..aa61591 100644
--- a/components/ContributionModal.tsx
+++ b/components/ContributionModal.tsx
@@ -17,6 +17,7 @@ import useVaults from '../hooks/useVaults'
import usePool from '../hooks/usePool'
import styled from '@emotion/styled'
import 'twin.macro'
+import { notify } from '../utils/notifications'
const SmallButton = styled.button``
@@ -126,9 +127,15 @@ const ContributionModal = () => {
useEffect(() => {
if (submitting) {
const handleSubmit = async () => {
- await actions.submitContribution(contributionAmount)
- setSubmitted(true)
- setSubmitting(false)
+ try {
+ await actions.submitContribution(contributionAmount)
+ } catch (e) {
+ notify({ type: 'error', message: e.message })
+ console.error(e.message)
+ } finally {
+ setSubmitted(false)
+ setSubmitting(false)
+ }
}
handleSubmit()
}
diff --git a/components/Notification.tsx b/components/Notification.tsx
index 43ab22c..7752364 100644
--- a/components/Notification.tsx
+++ b/components/Notification.tsx
@@ -29,7 +29,7 @@ const NotificationList = () => {
return (
{reversedNotifications.map((n, idx) => (
@@ -59,13 +59,11 @@ const Notification = ({ type, message, description, txid }) => {
{type === 'success' ? (
-
+
) : null}
- {type === 'info' && (
-
- )}
+ {type === 'info' && }
{type === 'error' && (
-
+
)}