update src/views/Home/Navbar/Mobile/index.js and Reset.js

front
amir hosein gorji 2 years ago
parent 08e6ff0bbe
commit 1f62402a2b
  1. 9
      src/views/Home/Navbar/Mobile/index.js
  2. 10
      src/views/Reset.js

@ -17,10 +17,6 @@ import { publicApi } from "~/Redux/actions";
import "./index.scss"; import "./index.scss";
function Navigate({ path }) {
let history = useHistory();
return <>{history.push(path)}</>;
}
function BackButton({ children }) { function BackButton({ children }) {
let history = useHistory(); let history = useHistory();
return ( return (
@ -84,6 +80,7 @@ function MobileNavbar(props) {
/> />
</div> </div>
); );
let history = useHistory();
if (!status) if (!status)
return ( return (
<nav <nav
@ -118,7 +115,7 @@ function MobileNavbar(props) {
// window.location.reload(); // window.location.reload();
window.reLang(e.target.value); window.reLang(e.target.value);
props.changeLanguage(); props.changeLanguage();
Navigate("/reset"); history.push("/reset");
}} }}
> >
{[ {[
@ -198,7 +195,7 @@ function MobileNavbar(props) {
// window.location.reload(); // window.location.reload();
window.reLang(e.target.value); window.reLang(e.target.value);
props.changeLanguage(); props.changeLanguage();
Navigate("/reset"); history.push("/reset");
}} }}
> >
{[ {[

@ -2,6 +2,14 @@ import React from "react";
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
export default function Reset() { export default function Reset() {
let history = useHistory(); let history = useHistory();
setTimeout(() => history.goBack(), 100);
if (!window.isReset)
setTimeout(() => {
window.isReset = false;
history.goBack();
history = {};
}, 100);
window.isReset = true;
return <>{""}</>; return <>{""}</>;
} }

Loading…
Cancel
Save