🚸(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:
committed by
aleb_the_flash
parent
886919c23d
commit
bc53916c68
@@ -65,6 +65,7 @@ export const useUser = (
|
||||
refetch: query.refetch,
|
||||
user: isLoggedOut ? undefined : (query.data as ApiUser | undefined),
|
||||
isLoggedIn,
|
||||
isLoading: query.isLoading,
|
||||
logout,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user