diff --git a/components/system/Dialogs/ScreenSaver/index.tsx b/components/system/Dialogs/ScreenSaver/index.tsx index 823ab4d7..58910f5d 100644 --- a/components/system/Dialogs/ScreenSaver/index.tsx +++ b/components/system/Dialogs/ScreenSaver/index.tsx @@ -4,7 +4,6 @@ import { type ComponentProcessProps } from "components/system/Apps/RenderCompone import { useFileSystem } from "contexts/fileSystem"; import { useProcesses } from "contexts/process"; import { TRANSITIONS_IN_MILLISECONDS } from "utils/constants"; -import { haltEvent } from "utils/functions"; const ONE_TIME_PASSIVE_CAPTURE_EVENT = { capture: true, @@ -41,18 +40,13 @@ const ScreenSaver: FC = ({ id }) => { }), [readFile, url] ); - const closeScreenSaver = useCallback( - (event?: Event) => { - if (event) haltEvent(event); + const closeScreenSaver = useCallback(() => { + if (iframeRef.current) { + iframeRef.current.style.display = "none"; + } - if (iframeRef.current) { - iframeRef.current.style.display = "none"; - } - - close(id); - }, - [close, id] - ); + close(id); + }, [close, id]); useEffect(() => { if (url && !srcDoc[url]) loadScreenSaver();