Skip to content

Commit

Permalink
Fix: CustomNavigate
Browse files Browse the repository at this point in the history
  • Loading branch information
KimKyuHoi committed Aug 4, 2024
1 parent 400088d commit 3a48e1e
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ if (import.meta.env.PROD) {
});
}

//TODO: Change it to navigate
const customNavigate = (path: string) => {
window.history.pushState({}, "", path);

window.dispatchEvent(new Event("popstate"));
};

const router = createBrowserRouter(routes);

axios.defaults.baseURL = import.meta.env.VITE_API_ADDR;
Expand Down Expand Up @@ -86,9 +79,9 @@ function App() {
queryCache: new QueryCache({
onError: (error) => {
if (isAxios404Error(error)) {
customNavigate("/404");
window.location.href = "/404";
} else if (isAxios500Error(error)) {
customNavigate("/404");
window.location.href = "/404";
} else {
handleError(error);
}
Expand Down

0 comments on commit 3a48e1e

Please sign in to comment.