fix
parent
0070e0da84
commit
f1319614e5
|
@ -10,16 +10,18 @@ import Login from "../pages/login";
|
||||||
|
|
||||||
// context
|
// context
|
||||||
import { useUserState } from "../context/UserContext";
|
import { useUserState } from "../context/UserContext";
|
||||||
|
import { useToast } from "../context/ToastContext";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
var { authenticated, messageCode } = useUserState();
|
var { authenticated, messageCode } = useUserState();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { notify } = useToast();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!messageCode) return;
|
if (!messageCode) return;
|
||||||
alert(t(messageCode));
|
notify(t(messageCode), "error");
|
||||||
}, [messageCode, t]);
|
}, [messageCode, t, notify]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HashRouter basename={process.env.PUBLIC_URL || ""}>
|
<HashRouter basename={process.env.PUBLIC_URL || ""}>
|
||||||
|
|
Loading…
Reference in New Issue