From e9956829d11a0a88d2816740b71297b9cb9cc70f Mon Sep 17 00:00:00 2001 From: Nathan Vasse Date: Mon, 19 Feb 2024 17:02:15 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(demo)=20remove=20ready=20fla?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This workaround was used as a workaround because default opened modals were causing a crash. See #269 --- apps/demo/src/Onboarding.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/demo/src/Onboarding.tsx b/apps/demo/src/Onboarding.tsx index d4c6197..848165f 100644 --- a/apps/demo/src/Onboarding.tsx +++ b/apps/demo/src/Onboarding.tsx @@ -1,22 +1,15 @@ -import React, { useEffect } from "react"; +import React from "react"; import { Button, Modal, ModalSize, useModal } from "@openfun/cunningham-react"; const Onboarding = () => { const modal = useModal({ isOpenDefault: true }); - // FIXME: remove this workaround once issue #259 will be resolved - // https://github.com/openfun/cunningham/issues/259 - const [ready, setReady] = React.useState(false); const handleClose = () => { sessionStorage.setItem("onboarded", "1"); modal.close(); }; - useEffect(() => { - setReady(true); - }, []); - - if (!ready || sessionStorage.getItem("onboarded")) return null; + if (sessionStorage.getItem("onboarded")) return null; return (