🐛(frontend) fix infinite loading for unauthenticated users on downloads
Reorganize exception handling in recording download screen to prevent unauthenticated users from getting stuck in loading state. Caught by production users - my bad;
This commit is contained in:
committed by
aleb_the_flash
parent
3368a9b6af
commit
5c8c81f97b
@@ -27,11 +27,11 @@ export const RecordingDownload = () => {
|
||||
enabled: !!recordingId,
|
||||
})
|
||||
|
||||
if (isLoading || !data || isAuthLoading) {
|
||||
if (isLoggedIn === undefined || isAuthLoading) {
|
||||
return <LoadingScreen />
|
||||
}
|
||||
|
||||
if (!isLoggedIn) {
|
||||
if (isLoggedIn === false && !isAuthLoading) {
|
||||
return (
|
||||
<ErrorScreen
|
||||
title={t('authentication.title')}
|
||||
@@ -40,7 +40,11 @@ export const RecordingDownload = () => {
|
||||
)
|
||||
}
|
||||
|
||||
if (isError) {
|
||||
if (isLoading) {
|
||||
return <LoadingScreen />
|
||||
}
|
||||
|
||||
if (isError || !data) {
|
||||
return <ErrorScreen title={t('error.title')} body={t('error.body')} />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user