Don't show studio error message while loading (#1791)

This commit is contained in:
WithoutPants
2021-10-03 11:01:07 +11:00
committed by GitHub
parent ea7a4f8d33
commit 52193586de

View File

@@ -49,7 +49,7 @@ export const Studio: React.FC = () => {
// Studio state // Studio state
const [image, setImage] = useState<string | null>(); const [image, setImage] = useState<string | null>();
const { data, error } = useFindStudio(id); const { data, loading: studioLoading, error } = useFindStudio(id);
const studio = data?.findStudio; const studio = data?.findStudio;
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
@@ -198,7 +198,7 @@ export const Studio: React.FC = () => {
} }
}; };
if (isLoading) return <LoadingIndicator />; if (isLoading || studioLoading) return <LoadingIndicator />;
if (error) return <ErrorMessage error={error.message} />; if (error) return <ErrorMessage error={error.message} />;
if (!studio?.id && !isNew) if (!studio?.id && !isNew)
return <ErrorMessage error={`No studio found with id ${id}.`} />; return <ErrorMessage error={`No studio found with id ${id}.`} />;