Skip to content

Commit

Permalink
fix: refresh client when new version is released (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoamGaash committed Apr 1, 2024
1 parent 1201893 commit a114051
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ const getRoutesList = () => {
)
}

window.addEventListener('vite:preloadError', () => {
window.location.reload() // in case new version is released, we will need to refresh the page. see https://vitejs.dev/guide/build#load-error-handling
})

const routes = createRoutesFromElements(getRoutesList())

const router = createBrowserRouter(routes)
Expand Down

0 comments on commit a114051

Please sign in to comment.