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";
function Navigate({ path }) {
let history = useHistory();
return <>{history.push(path)}</>;
}
function BackButton({ children }) {
let history = useHistory();
return (
@ -84,6 +80,7 @@ function MobileNavbar(props) {
/>
</div>
);
let history = useHistory();
if (!status)
return (
<nav
@ -118,7 +115,7 @@ function MobileNavbar(props) {
// window.location.reload();
window.reLang(e.target.value);
props.changeLanguage();
Navigate("/reset");
history.push("/reset");
}}
>
{[
@ -198,7 +195,7 @@ function MobileNavbar(props) {
// window.location.reload();
window.reLang(e.target.value);
props.changeLanguage();
Navigate("/reset");
history.push("/reset");
}}
>
{[

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

Loading…
Cancel
Save