diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 74646b46..183129f8 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -18,7 +18,6 @@ import { getUserMenu } from './UserMenu'; import { getUserName } from '../utils/users'; import { languagesOptions } from 'src/utils/languages'; import { selectCurrentUser } from '../state/slices/auth'; -import { useNotifications } from 'src/hooks/useNotifications'; import { usePrismicData } from '../libs/Prismic/components/PrismicDataProvider'; import { useRouter } from 'next/router'; import { useSelector } from 'react-redux'; @@ -248,11 +247,6 @@ const Sidebar = () => { const { user } = useSelector(selectCurrentUser); const { address } = useWallet(); - const { notifications, mutate } = useNotifications([ - `unreadOnly=true`, - `isWebApp=true` - ]); - const [data, setData] = useState(); const { userConfig, extractFromConfig } = usePrismicData(); @@ -300,21 +294,18 @@ const Sidebar = () => { const footerMenu = [...footerCommonMenu, ...footerUserMenu]; - // Mutate Notifications - mutate(); - setData({ commonMenu, flags: [ { key: 'notifications', - value: notifications?.count + value: user?.notificationsCount } ], footerMenu, menus }); - }, [asPath, user, notifications, locale, address, mutate]); + }, [asPath, user, locale, address]); const footerMenu = () => { const userBeneficiary = user?.roles?.includes('beneficiary'); diff --git a/src/helpers/handleKnownErrors.ts b/src/helpers/handleKnownErrors.ts index 435603f0..03b3edc4 100644 --- a/src/helpers/handleKnownErrors.ts +++ b/src/helpers/handleKnownErrors.ts @@ -9,6 +9,10 @@ export const handleKnownErrors = (error: any) => { ); } else if (errorMessage.includes("don't have enough funds to borrow")) { toast.error(`You don't have enough funds to borrow this amount.`); + } else if (errorMessage.includes('user already has an active loan')) { + toast.error( + `You can't approve this loan because you already have an active loan.` + ); } else { toast.error('An error has ocurred. Please try again later.'); } diff --git a/src/views/MicrocreditManager/ApproveRejectTab/BorrowersList.tsx b/src/views/MicrocreditManager/ApproveRejectTab/BorrowersList.tsx index 100d7319..c44638f1 100644 --- a/src/views/MicrocreditManager/ApproveRejectTab/BorrowersList.tsx +++ b/src/views/MicrocreditManager/ApproveRejectTab/BorrowersList.tsx @@ -63,9 +63,9 @@ const loanStatus = (status: any) => { case 3: // Requested Changes badgeContent = ( <> - + - In Revision + Revise ); diff --git a/src/views/MicrocreditManager/ApproveRejectTab/index.tsx b/src/views/MicrocreditManager/ApproveRejectTab/index.tsx index ef1764d0..a93803ac 100644 --- a/src/views/MicrocreditManager/ApproveRejectTab/index.tsx +++ b/src/views/MicrocreditManager/ApproveRejectTab/index.tsx @@ -200,7 +200,7 @@ const ApproveRejectTab: React.FC<{}> = () => { { number: countReqChanges || 0, onClick: () => update({ page: 1, status: '3' }), - title: 'In Revision' + title: 'Revise' } ];