optimize boot sequnse

This commit is contained in:
hansoo
2025-03-19 07:27:10 +09:00
parent ab3bcbdc63
commit 2ec913c6c0
12 changed files with 224 additions and 180 deletions

View File

@@ -22,7 +22,7 @@ import Settings from './pages/Settings';
import { BudgetProvider } from './contexts/BudgetContext';
import PrivateRoute from './components/auth/PrivateRoute';
// 전역 오류 핸들러
const handleError = (error: any) => {
const handleError = (error: Error | unknown) => {
console.error('앱 오류 발생:', error);
};
@@ -77,7 +77,7 @@ function App() {
// 웹뷰 콘텐츠가 완전히 로드되었을 때만 스플래시 화면을 숨김
const onAppReady = async () => {
try {
// 1초 후에 스플래시 화면을 숨김 (콘텐츠가 완전히 로드될 시간 확보)
// 스플래시 화면을 더 빠르게 숨김 (데이터 로딩과 별도로 진행)
setTimeout(async () => {
try {
await SplashScreen.hide();
@@ -85,7 +85,7 @@ function App() {
} catch (err) {
console.error('스플래시 화면 숨김 오류:', err);
}
}, 1000);
}, 500); // 500ms로 줄임
} catch (err) {
console.error('앱 준비 오류:', err);
}
@@ -96,9 +96,13 @@ function App() {
// 추가 보호장치: 페이지 로드 시 다시 실행
const handleLoad = () => {
// 즉시 스플래시 화면을 숨김 시도
SplashScreen.hide().catch(() => {});
// 백업 시도
setTimeout(() => {
SplashScreen.hide().catch(() => {});
}, 1000);
}, 300);
};
window.addEventListener('load', handleLoad);