Skip to content

Commit

Permalink
disable confetti for firefox (lags idk why)
Browse files Browse the repository at this point in the history
  • Loading branch information
naueramant committed May 20, 2024
1 parent 8cfe24d commit d27458c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/views/Game/components/ChugDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import {
Stack,
Typography,
} from "@mui/material";
import { detect } from "detect-browser";
import { FunctionComponent, useEffect, useRef, useState } from "react";
import ReactConfetti from "react-confetti";
import { useSounds } from "../../../hooks/sounds";
import { milisecondsToMMSSsss } from "../../../utilities/time";

const browser = detect();

interface ChugDialogProps extends DialogProps {}

const ChugDialog: FunctionComponent<ChugDialogProps> = (props) => {
Expand Down Expand Up @@ -86,7 +89,10 @@ const ChugDialog: FunctionComponent<ChugDialogProps> = (props) => {

return (
<>
{props.open && <ReactConfetti />}
{/*
Firefox lags with confetti, don't know why, so we disable it for now
*/}
{props.open && browser?.name !== "firefox" && <ReactConfetti />}

<Dialog
{...props}
Expand Down

0 comments on commit d27458c

Please sign in to comment.