[LoadingPanel] 로딩바 animation까지 사라진 뒤에 포커스 이벤트 되도록 로직 수정

This commit is contained in:
hyunwoo93.cha
2024-05-28 21:25:41 +09:00
parent a96d7c5557
commit af76e562f2

View File

@@ -45,6 +45,20 @@ export default function LoadingPanel({ showLoadingPanel, ...rest }) {
const resumeSpotlightTimeoutRef = useRef(null);
useEffect(() => {
if (showLoadingPanel.show) {
const handleKeyDown = (e) => {
e.stopPropagation();
e.preventDefault();
};
window.addEventListener("keydown", handleKeyDown, true);
return () => {
window.removeEventListener("keydown", handleKeyDown, true);
};
}
}, [showLoadingPanel]);
useEffect(() => {
return () => {
if (minShowingTimeJob) minShowingTimeJob.stop();
@@ -61,6 +75,12 @@ export default function LoadingPanel({ showLoadingPanel, ...rest }) {
}
}, [readyToHide, showLoadingPanel]);
useEffect(() => {
if (!showingStatus.showing && !showingStatus.hiding) {
Spotlight.resume();
}
}, [showingStatus]);
useEffect(() => {
if (!showingStatus.showing) {
if (showingStatus.hiding) {
@@ -88,7 +108,7 @@ export default function LoadingPanel({ showLoadingPanel, ...rest }) {
resumeSpotlightTimeoutRef.current = setTimeout(() => {
if (!showLoadingPanel.show && readyToHide && readyToAni) {
dispatch(loadingComplete(true));
Spotlight.resume();
setShowingStatus({ showing: false, hiding: true });
}
}, HIDING_TIME);
}