Skip to content

Commit

Permalink
fix: revalidate getModels after confirming modelsBackPopulated
Browse files Browse the repository at this point in the history
  • Loading branch information
ivyjeong13 committed Dec 19, 2024
1 parent a053c1f commit a18fbc9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { useEffect, useState } from "react";
import useSWR from "swr";
import useSWR, { mutate } from "swr";

import { ModelProvider } from "~/lib/model/modelProviders";
import { NotFoundError } from "~/lib/service/api/apiErrors";
import { ModelApiService } from "~/lib/service/api/modelApiService";
import { ModelProviderApiService } from "~/lib/service/api/modelProviderApiService";

import { ModelProviderForm } from "~/components/model-providers/ModelProviderForm";
Expand Down Expand Up @@ -55,6 +56,8 @@ export function ModelProviderConfigure({
if (data?.modelsBackPopulated) {
setShowDefaultModelAliasForm(true);
setLoadingModelProviderId("");
// revalidate models to get back populated models
mutate(ModelApiService.getModels.key());
}
}, [getLoadingModelProviderModels, loadingModelProviderId]);

Expand Down

0 comments on commit a18fbc9

Please sign in to comment.