🚸(frontend) prevent auth screen flashing during user data fetch

Fix UI flickering where authentication screen briefly appeared for logged-in
users during initial data loading. Address issue caused by increased request
delay from waterfall cascade introduced by configurable silent auth setting.
This commit is contained in:
lebaudantoine
2025-04-18 10:52:46 +02:00
committed by aleb_the_flash
parent 886919c23d
commit bc53916c68
2 changed files with 3 additions and 2 deletions

View File

@@ -65,6 +65,7 @@ export const useUser = (
refetch: query.refetch,
user: isLoggedOut ? undefined : (query.data as ApiUser | undefined),
isLoggedIn,
isLoading: query.isLoading,
logout,
}
}

View File

@@ -17,7 +17,7 @@ import { RecordingStatus } from '@/features/recording'
export const RecordingDownload = () => {
const { t } = useTranslation('recording')
const { recordingId } = useParams()
const { isLoggedIn } = useUser()
const { isLoggedIn, isLoading: isAuthLoading } = useUser()
const { data, isLoading, isError } = useQuery({
queryKey: ['recording', recordingId],
@@ -26,7 +26,7 @@ export const RecordingDownload = () => {
enabled: !!recordingId,
})
if (isLoading || !data) {
if (isLoading || !data || isAuthLoading) {
return <LoadingScreen />
}