Skip to content

Commit

Permalink
empty fullscreen fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Oct 2, 2024
1 parent b4f447f commit 338729d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions client/src/containers/welcome-message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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";
Expand Down Expand Up @@ -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 (
<Dialog open={!cookies.welcome}>
Expand Down

0 comments on commit 338729d

Please sign in to comment.