Skip to content

Commit

Permalink
fix UI bug
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Linville <[email protected]>
  • Loading branch information
g-linville committed Jan 16, 2025
1 parent 49780f5 commit ba0d4c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ export function ProviderConfigure({ provider }: ProviderConfigureProps) {
useEffect(() => {
if (!loadingProviderId) return;

if (provider.type === "authprovider") {
setDialogIsOpen(false);
return;
}

const { isLoading, data } = getLoadingModelProviderModels;
if (isLoading) return;

Expand All @@ -63,7 +58,7 @@ export function ProviderConfigure({ provider }: ProviderConfigureProps) {
// revalidate models to get back populated models
mutate(ModelApiService.getModels.key());
}
}, [getLoadingModelProviderModels, loadingProviderId, provider.type]);
}, [getLoadingModelProviderModels, loadingProviderId]);

const handleDone = () => {
setDialogIsOpen(false);
Expand Down Expand Up @@ -110,7 +105,11 @@ export function ProviderConfigure({ provider }: ProviderConfigureProps) {
) : (
<ProviderConfigureContent
provider={provider}
onSuccess={() => setLoadingProviderId(provider.id)}
onSuccess={() =>
provider.type === "modelprovider"
? setLoadingProviderId(provider.id)
: setDialogIsOpen(false)
}
/>
)}
</DialogContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ export function ProviderForm({
AuthProviderApiService.configureAuthProviderById,
{
onSuccess: async () => {
mutate(AuthProviderApiService.revealAuthProviderById.key(provider.id));
mutate(AuthProviderApiService.getAuthProviders.key());
onSuccess();
mutate(AuthProviderApiService.getAuthProviders.key());
mutate(AuthProviderApiService.revealAuthProviderById.key(provider.id));
},
}
);
Expand Down

0 comments on commit ba0d4c7

Please sign in to comment.