fix loading 2

This commit is contained in:
2025-06-19 17:27:16 +09:00
parent 8541af9293
commit 00386037bc
3 changed files with 15 additions and 2 deletions

View File

@@ -24,6 +24,13 @@ export default function App() {
// Event listeners for blog communication
useEffect(() => {
// Clear OAuth completion flag once app is loaded
if (sessionStorage.getItem('oauth_just_completed') === 'true') {
setTimeout(() => {
sessionStorage.removeItem('oauth_just_completed')
}, 1000)
}
const handleAIQuestion = (event) => {
const { question } = event.detail
if (question && adminData && user && agent) {
@@ -67,7 +74,11 @@ export default function App() {
const isLoading = authLoading || dataLoading || userLoading
if (isLoading) {
// Don't show loading if we just completed OAuth callback
const isOAuthReturn = window.location.pathname === '/oauth/callback' ||
sessionStorage.getItem('oauth_just_completed') === 'true'
if (isLoading && !isOAuthReturn) {
return (
<div style={{
display: 'flex',

View File

@@ -38,6 +38,8 @@ export function useAuth() {
user: authResult.user
}, '*')
} else {
// Set flag to skip loading screen after redirect
sessionStorage.setItem('oauth_just_completed', 'true')
// Direct redirect
setTimeout(() => {
window.location.href = returnUrl