From f1319614e530c3d27999944ad50eefacd4047563 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Fri, 30 Jul 2021 03:41:24 +0300 Subject: [PATCH] fix --- src/components/App.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/App.js b/src/components/App.js index 7f6ca2f..19c1d81 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -10,16 +10,18 @@ import Login from "../pages/login"; // context import { useUserState } from "../context/UserContext"; +import { useToast } from "../context/ToastContext"; import { useTranslation } from "react-i18next"; export default function App() { var { authenticated, messageCode } = useUserState(); const { t } = useTranslation(); + const { notify } = useToast(); useEffect(() => { if (!messageCode) return; - alert(t(messageCode)); - }, [messageCode, t]); + notify(t(messageCode), "error"); + }, [messageCode, t, notify]); return (