optimize boot sequnse
This commit is contained in:
12
src/App.tsx
12
src/App.tsx
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user