fix: add verification for path /404 (#3723)

Co-authored-by: coolstorm <manas.gupta@fampay.in>
This commit is contained in:
Manas Gupta 2024-08-06 02:32:47 +05:30 committed by GitHub
parent 76627c2076
commit c7e30522bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
})