Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix unsupported browser alert
  • Loading branch information
regalijan committed Nov 19, 2024
1 parent 6d357e4 commit 31af6fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/routes/events-team_.outstanding.tsx
Expand Up @@ -25,7 +25,7 @@ import {
VStack,
} from "@chakra-ui/react";
import { useLoaderData } from "@remix-run/react";
import { useState } from "react";
import { useEffect, useState } from "react";

export async function loader({ context }: { context: RequestContext }) {
const now = new Date();
Expand Down Expand Up @@ -56,6 +56,10 @@ export default function () {
const [isBrowserSupported, setIsBrowserSupported] = useState(true);
const toast = useToast();

useEffect(() => {
if (typeof structuredClone === "undefined") setIsBrowserSupported(false);
}, []);

async function displayErrorToast(response: Response, title: string) {
let msg = "Unknown error";

Expand Down Expand Up @@ -197,7 +201,7 @@ export default function () {
<AlertIcon />
The cutoff period for retroactively actioning events has passed.
</Alert>
<Alert display={isBrowserSupported ? undefined : "none"} status="error">
<Alert display={isBrowserSupported ? "none" : undefined} status="error">
<AlertIcon />
This browser is unsupported. Please upgrade to a browser not several
years out of date.
Expand Down

0 comments on commit 31af6fa

Please sign in to comment.