Skip to content

Commit

Permalink
fix: add verification for path /404 (#3723)
Browse files Browse the repository at this point in the history
Co-authored-by: coolstorm <manas.gupta@fampay.in>
  • Loading branch information
Manas1820 and cool-storm authored Aug 5, 2024
1 parent 76627c2 commit c7e3052
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion reflex/.templates/web/utils/client_side_routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export const useClientSideRouting = () => {
router.replace({
pathname: window.location.pathname,
query: window.location.search.slice(1),
})
}).then(()=>{
// Check if the current route is /404
if (router.pathname === '/404') {
setRouteNotFound(true); // Mark as an actual 404
}
})
.catch((e) => {
setRouteNotFound(true) // navigation failed, so this is a real 404
})
Expand Down

0 comments on commit c7e3052

Please sign in to comment.