Skip to content
Snippets Groups Projects
Unverified Commit 27f1a44e authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

Solve toast issue with InviteInvalid (#4689)

parent ec7765b0
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ export default function App() { ...@@ -39,7 +39,7 @@ export default function App() {
<Toaster <Toaster
position="bottom-right" position="bottom-right"
toastOptions={{ toastOptions={{
duration: 3000, duration: 4000,
}} }}
/> />
<Footer /> <Footer />
......
import React, { useEffect } from 'react'; import React, { useEffect, useMemo } from 'react';
import { import {
Col, Row, Col, Row,
} from 'react-bootstrap'; } from 'react-bootstrap';
...@@ -31,15 +31,13 @@ export default function HomePage() { ...@@ -31,15 +31,13 @@ export default function HomePage() {
[currentUser.signed_in], [currentUser.signed_in],
); );
useEffect(() => { // hack to deal with the fact that useEffect and toast dont work together very well
useMemo(() => {
if (error === 'InviteInvalid') { if (error === 'InviteInvalid') {
toast.error(t('toast.error.users.invalid_invite')); toast.error(t('toast.error.users.invalid_invite'));
} }
}, [error]); }, [error]);
// Small hack because the InviteInvalid toast won't fire unless this is here (I have no idea why)
toast.success('hidden', { style: { display: 'none' } });
return ( return (
<> <>
<Row className="wide-white"> <Row className="wide-white">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment