diff --git a/client/src/containers/welcome-message/index.tsx b/client/src/containers/welcome-message/index.tsx index 8650af0..87662b5 100644 --- a/client/src/containers/welcome-message/index.tsx +++ b/client/src/containers/welcome-message/index.tsx @@ -2,6 +2,8 @@ import { useEffect, useRef, useState } from "react"; +import isEmpty from "lodash-es/isEmpty"; + import { useCookies } from "react-cookie"; import ReactPlayer from "react-player"; @@ -10,8 +12,6 @@ import Image from "next/image"; import { LuPlay } from "react-icons/lu"; import screenfull from "screenfull"; -import env from "@/env.mjs"; - import { cn } from "@/lib/classnames"; import { useGetWelcomeMessage } from "@/types/generated/welcome-message"; @@ -43,14 +43,15 @@ export default function WelcomeMessage() { const handleFullscreen = () => { setFullscreen(screenfull?.isFullscreen); }; - - // useEffect(() => { - // screenfull?.on("change", handleFullscreen); - - // return () => { - // screenfull?.off("change", handleFullscreen); - // }; - // }, []); + useEffect(() => { + if (!isEmpty(screenfull)) { + screenfull?.on("change", handleFullscreen); + + return () => { + screenfull?.off("change", handleFullscreen); + }; + } + }, []); return (