Skip to content

Commit

Permalink
return wallet sanctioned for all addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
HrithikSampson committed Sep 10, 2024
1 parent 72b115f commit edfa667
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/modals/SanctionedModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import {
brandColors,
Button,
Expand All @@ -21,12 +21,26 @@ interface SanctionModalProps {

export const SanctionModal: React.FC<SanctionModalProps> = ({ closeModal }) => {
const { formatMessage } = useIntl();
const [isRedirecting, setIsRedirecting] = useState(false);
const router = useRouter();
const navigateToAllProjects = () => {
setIsRedirecting(true);
router.push(Routes.AllProjects);
closeModal();
};

useEffect(() => {
const handleRouteChangeComplete = () => {
closeModal();
setIsRedirecting(false);
};
if(isRedirecting) {

Check failure on line 36 in src/components/modals/SanctionedModal.tsx

View workflow job for this annotation

GitHub Actions / build

Insert `·`
router.events.on('routeChangeComplete', handleRouteChangeComplete);
}
return () => {
router.events.off('routeChangeComplete', handleRouteChangeComplete);
};
}, [isRedirecting]);

return (
<Modal
closeModal={closeModal}
Expand Down

0 comments on commit edfa667

Please sign in to comment.