Skip to content

Commit

Permalink
[new-set-state-function] - fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiLeme committed Oct 21, 2024
1 parent 65f7433 commit 003420a
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export function IterativeSyncCurrentState(props: IterativeSyncCurrentStateProps)
pluginApi, userId, userName, setFullscreenItem, setHasSyncCurentStateFlow,
} = props;

const [h5pDomElemnt, setH5pDomElemnt] = useState<HTMLIFrameElement>(null);
const h5pStateController = h5pDomElemnt?.contentWindow as WindowWithH5p;
const [h5pDomElement, setH5pDomElement] = useState<HTMLIFrameElement>(null);
const h5pStateController = h5pDomElement?.contentWindow as WindowWithH5p;

const {
data: responseUserH5pCurrentStateList,
Expand All @@ -34,11 +34,11 @@ export function IterativeSyncCurrentState(props: IterativeSyncCurrentStateProps)
}, [responseUserH5pCurrentStateList]);

useEffect(() => {
if (h5pDomElemnt
&& !(h5pDomElemnt?.contentWindow as WindowWithH5p)?.H5P?.instances[0].setCurrentState) {
if (h5pDomElement
&& !(h5pDomElement?.contentWindow as WindowWithH5p)?.H5P?.instances[0].setCurrentState) {
setHasSyncCurentStateFlow(false);
}
}, [h5pDomElemnt]);
}, [h5pDomElement]);

if (responseUserH5pCurrentStateList.loading) return null;
return (
Expand All @@ -50,7 +50,7 @@ export function IterativeSyncCurrentState(props: IterativeSyncCurrentStateProps)
setFullscreenItem={setFullscreenItem}
>
<H5pStateRendererComponent
setH5pDomElement={setH5pDomElemnt}
setH5pDomElement={setH5pDomElement}
isResetH5pComponentFlow={false}
currentH5pStateToBeApplied={dataToRender?.currentState}
contentAsJson={contentAsJson}
Expand Down

0 comments on commit 003420a

Please sign in to comment.