From 00386037bc7c932cdd454cac217621ce78e8efce Mon Sep 17 00:00:00 2001 From: syui Date: Thu, 19 Jun 2025 17:27:16 +0900 Subject: [PATCH] fix loading 2 --- my-blog/static/oauth/index.html | 2 +- oauth/src/App.jsx | 13 ++++++++++++- oauth/src/hooks/useAuth.js | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/my-blog/static/oauth/index.html b/my-blog/static/oauth/index.html index ee853ad..f44febe 100644 --- a/my-blog/static/oauth/index.html +++ b/my-blog/static/oauth/index.html @@ -1,3 +1,3 @@ - + diff --git a/oauth/src/App.jsx b/oauth/src/App.jsx index 11fac13..a6fafd8 100644 --- a/oauth/src/App.jsx +++ b/oauth/src/App.jsx @@ -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 (
{ window.location.href = returnUrl