fix: enhance back navigation in NotFoundPage component

This commit is contained in:
Bram Suurd
2025-11-21 23:04:44 +01:00
parent 06d8e5354a
commit 1b125b90b6

View File

@@ -12,7 +12,17 @@ export default function NotFoundPage() {
Oops, the page you are looking for could not be found. Oops, the page you are looking for could not be found.
</p> </p>
</div> </div>
<Button onClick={() => window.history.back()} variant="secondary"> <Button
onClick={() => {
if (window.history.length > 1) {
window.history.back();
}
else {
window.location.href = "/";
}
}}
variant="secondary"
>
Go Back Go Back
</Button> </Button>
</div> </div>