master
Tudor Stanciu 2021-07-30 03:41:24 +03:00
parent 0070e0da84
commit f1319614e5
1 changed files with 4 additions and 2 deletions

View File

@ -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 (
<HashRouter basename={process.env.PUBLIC_URL || ""}>