fix: 로그인 창을 처음 열 때 버벅이던 것 줄임 — 구글 로그인 스크립트는 한가할 때 미리 받고, 구글 버튼과 뒤 화면 멈추기는 창이 다 올라온 뒤에

This commit is contained in:
minaChoi committed 2026-10-27 14:39:41 +09:00
1 parent 7d84226105
commit 7dcd6c6a4c
5 files changed
+65 -36

No files matched your search

+4 -2
View File
@@ -34,7 +34,7 @@ import { ago, articleMeta, AVATAR_COLORS, cardBg, CHARACTERS, dateRange, loadOf,
import { GoogleButton } from './googleLogin'
import { useInstall, useInstallable } from './install'
import { InstallSheet } from './installBanner'
import { ARTICLE_CAT } from './lib'
import { ARTICLE_CAT, SHEET_OPEN_MS } from './lib'
import { MixSheet } from './myGak'
import { ownPage, useRegion } from './regionContext'
import { WeatherWhySheet } from './weatherWhy'
@@ -109,8 +109,10 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void
const root = document.documentElement
const before = root.style.overflow
root.style.overflow = 'hidden'
root.classList.add('b-sheet-open')
// 뒤 화면 움직임 멈추기는 페이지 전체 스타일을 다시 계산하게 해서, 창이 다 올라온 뒤에 한다
const pause = setTimeout(() => root.classList.add('b-sheet-open'), SHEET_OPEN_MS)
return () => {
clearTimeout(pause)
root.style.overflow = before
root.classList.remove('b-sheet-open')
}