fix loading 2
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
<!-- OAuth Comment System - Load globally for session management -->
|
<!-- OAuth Comment System - Load globally for session management -->
|
||||||
<script type="module" crossorigin src="/assets/comment-atproto-BQKPMV57.js"></script>
|
<script type="module" crossorigin src="/assets/comment-atproto-B0LQfPij.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/comment-atproto-BUFiApUA.css">
|
<link rel="stylesheet" crossorigin href="/assets/comment-atproto-BUFiApUA.css">
|
||||||
|
@@ -24,6 +24,13 @@ export default function App() {
|
|||||||
|
|
||||||
// Event listeners for blog communication
|
// Event listeners for blog communication
|
||||||
useEffect(() => {
|
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 handleAIQuestion = (event) => {
|
||||||
const { question } = event.detail
|
const { question } = event.detail
|
||||||
if (question && adminData && user && agent) {
|
if (question && adminData && user && agent) {
|
||||||
@@ -67,7 +74,11 @@ export default function App() {
|
|||||||
|
|
||||||
const isLoading = authLoading || dataLoading || userLoading
|
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 (
|
return (
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
@@ -38,6 +38,8 @@ export function useAuth() {
|
|||||||
user: authResult.user
|
user: authResult.user
|
||||||
}, '*')
|
}, '*')
|
||||||
} else {
|
} else {
|
||||||
|
// Set flag to skip loading screen after redirect
|
||||||
|
sessionStorage.setItem('oauth_just_completed', 'true')
|
||||||
// Direct redirect
|
// Direct redirect
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = returnUrl
|
window.location.href = returnUrl
|
||||||
|
Reference in New Issue
Block a user