fix loading 2
This commit is contained in:
@@ -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',
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user