Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

fix(ui): render provider retry as loading, not stale error

Josh Corbett9bf83f469ebf
diff --git a/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsx b/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsx
index 02d918dade..e34d78528d 100644
--- a/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsx
+++ b/invokeai/frontend/webv2/src/features/models/ui/credentials/ExternalProviderKeyCards.tsx
@@ -41,6 +41,7 @@ export const ExternalProviderKeyCards = ({ onError }: { onError: (title: string,
const { t } = useTranslation();
const configs = useExternalProvidersSelector((snapshot) => snapshot.configs);
const loadError = useExternalProvidersSelector((snapshot) => snapshot.error);
+ const status = useExternalProvidersSelector((snapshot) => snapshot.status);
useMountEffect(() => {
ensureExternalProvidersLoaded().catch(() => {
@@ -48,10 +49,12 @@ export const ExternalProviderKeyCards = ({ onError }: { onError: (title: string,
});
});
- if (loadError !== null && (configs === null || configs.length === 0)) {
+ // Only a settled failure renders as an error — a retry in flight after a
+ // remount shows nothing rather than the previous attempt's stale message.
+ if (status === 'error') {
return (
<Text color="fg.error" fontSize="2xs">
- {t('models.externalProvidersUnavailable', { error: loadError })}
+ {t('models.externalProvidersUnavailable', { error: loadError ?? t('models.failedToLoadExternalProviders') })}
</Text>
);
}