Skip to content

Commit

Permalink
Reload Page on Crash
Browse files Browse the repository at this point in the history
  • Loading branch information
gigincg committed Jan 17, 2025
1 parent 2b921f7 commit b5cf957
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/ErrorPages/DefaultErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Link } from "raviger";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";

import { Button } from "../ui/button";

type ErrorType = "PAGE_NOT_FOUND" | "PAGE_LOAD_ERROR" | "CUSTOM_ERROR";

interface ErrorPageProps {
Expand Down Expand Up @@ -54,12 +55,15 @@ export default function ErrorPage({
{message}
<br />
<br />
<Link
href="/"
<Button
onClick={() =>
// Refresh the Page
window.location.reload()
}
className="inline-block rounded-lg bg-primary-600 px-4 py-2 text-white hover:bg-primary-700 hover:text-white"
>
{t("return_to_care")}
</Link>
</Button>
</p>
</div>
</div>
Expand Down

0 comments on commit b5cf957

Please sign in to comment.