Skip to content

Commit

Permalink
Improve Care crash page redirection (#10025)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishith25 authored Jan 17, 2025
1 parent d5c106f commit c5c52b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/ErrorPages/DefaultErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";

import useAppHistory from "@/hooks/useAppHistory";

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

type ErrorType = "PAGE_NOT_FOUND" | "PAGE_LOAD_ERROR" | "CUSTOM_ERROR";
Expand All @@ -18,6 +20,7 @@ export default function ErrorPage({
...props
}: ErrorPageProps) {
const { t } = useTranslation();
const { goBack } = useAppHistory();

useEffect(() => {
toast.dismiss();
Expand Down Expand Up @@ -56,10 +59,11 @@ export default function ErrorPage({
<br />
<br />
<Button
onClick={() =>
onClick={() => {
// Refresh the Page
window.location.reload()
}
goBack("/");
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")}
Expand Down

0 comments on commit c5c52b6

Please sign in to comment.