[Chore/Refactor] Implement lazy initialization for useState calls to prevent re-computation (#26252)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: asukaminato0721 <30024051+asukaminato0721@users.noreply.github.com>
This commit is contained in:
Copilot 2025-09-29 20:35:55 +09:00 • committed by GitHub
commit df43c6ab8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 24 additions and 24 deletions

View file

@ -6,7 +6,7 @@ import { useLanguage } from '@/app/components/header/account-setting/model-provi
const MaintenanceNotice = () => {
const locale = useLanguage()
const [showNotice, setShowNotice] = useState(localStorage.getItem('hide-maintenance-notice') !== '1')
const [showNotice, setShowNotice] = useState(() => localStorage.getItem('hide-maintenance-notice') !== '1')
const handleJumpNotice = () => {
window.open(NOTICE_I18N.href, '_blank')
}