fix: 앱이 뜨기 전 정적 소개 글(Q&A)이 잠깐 보이던 것 — index.html 첫 화면에 '날씨 불러오는 중…'을 덮고 앱이 뜨면 걷는다

This commit is contained in:
minaChoi committed 2026-10-12 17:06:31 +09:00
1 parent 1324898a71
commit 9a82cfbedc
2 files changed
+8 -5

No files matched your search

+3 -5
View File
@@ -3,7 +3,7 @@ import { NavLink, Outlet, useLocation } from 'react-router'
import { useIsFetching, useQuery } from '@tanstack/react-query'
import { getSeasonWeekOptions } from '../api/client/@tanstack/react-query.gen'
import { cx } from '../lib/utils'
import { kindOfHour, kst, type TimeKind } from './lib'
import { kindOfHour, kst, seasonOf, type TimeKind } from './lib'
import './b.css'
import { AuthProvider } from './auth'
import { RegionProvider } from './region'
@@ -24,10 +24,6 @@ const TABS = [
{ to: '/season', key: 'season', label: '계절·상식', title: '계절·상식' },
] as const
// 달(1~12) → 계절 이름과 아이콘
const SEASONS: [string, string][] = [['겨울', 'snow'], ['봄', 'garden'], ['여름', 'sun'], ['가을', 'maple']]
const seasonOf = (month: number) => SEASONS[Math.floor((month % 12) / 3)]
/** 로고 옆 계절 칩: 계절 이름과 지금 절기. 누르면 이번 주 절기 창. 좁은 화면에선 절기를 뺀다 */
function SeasonChip() {
const { open } = useSheet()
@@ -184,6 +180,8 @@ function FirstLoad() {
// 받기 시작했다가 받는 게 없어지면 끝 (렌더 중에 바로 맞춘다)
if (fetching > 0 && !started) setStarted(true)
if (fetching === 0 && started && !done) setDone(true)
// 앱이 떴으니 index.html 의 첫 화면은 걷는다 (이 덮개가 이어받는다)
useEffect(() => document.getElementById('boot')?.remove(), [])
// 느린 망에서도 10초 넘게 막지 않는다 (그 뒤는 화면 안 스켈레톤이 맡는다)
useEffect(() => {
const id = setTimeout(() => setDone(true), 10000)