Address potential crashes
Some checks are pending
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run

This commit is contained in:
Kalle
2024-10-15 22:17:50 +03:00
parent da972c1931
commit 2356a7195f
4 changed files with 15 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
import { Link, useLocation, useMatches } from "@remix-run/react";
import clsx from "clsx";
import * as React from "react";
import { ErrorBoundary } from "react-error-boundary";
import { useTranslation } from "react-i18next";
import { useIsMounted } from "~/hooks/useIsMounted";
import type { RootLoaderData } from "~/root";
@@ -155,5 +156,9 @@ function MyRampUnit() {
return <div className="top-leaderboard" />;
}
return <RampUnit type="leaderboard_atf" cssClass="top-leaderboard" />;
return (
<ErrorBoundary fallback={null}>
<RampUnit type="leaderboard_atf" cssClass="top-leaderboard" />
</ErrorBoundary>
);
}

View File

@@ -113,6 +113,7 @@ export default class Ramp extends React.Component {
componentWillUnmount() {
window.ramp.que.push(() => {
if (!this.unitToAdd) return;
cleanUp(this.unitToAdd.selectorId);
});
}

View File

@@ -78,6 +78,7 @@ export default class RampUnit extends React.Component {
}
componentWillUnmount() {
window.ramp.que.push(() => {
if (!this.unitToAdd) return;
cleanUp(this.unitToAdd.selectorId);
});
}

View File

@@ -18,6 +18,7 @@ import {
import generalI18next from "i18next";
import NProgress from "nprogress";
import * as React from "react";
import { ErrorBoundary as ClientErrorBoundary } from "react-error-boundary";
import { useTranslation } from "react-i18next";
import { useChangeLanguage } from "remix-i18next/react";
import type { SendouRouteHandle } from "~/utils/remix";
@@ -474,9 +475,11 @@ function MyRamp({ data }: { data: RootLoaderData | undefined }) {
}
return (
<Ramp
publisherId={import.meta.env.VITE_PLAYWIRE_PUBLISHER_ID}
id={import.meta.env.VITE_PLAYWIRE_WEBSITE_ID}
/>
<ClientErrorBoundary fallback={null}>
<Ramp
publisherId={import.meta.env.VITE_PLAYWIRE_PUBLISHER_ID}
id={import.meta.env.VITE_PLAYWIRE_WEBSITE_ID}
/>
</ClientErrorBoundary>
);
}