Skip to content

Commit

Permalink
update unique logic for providers
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Stafford committed Oct 11, 2024
1 parent 39fa4b4 commit fc8929e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/pages/playground/PlaygroundCredentialsDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const ProviderToCredentialKeyMap: Record<ModelProvider, CredentialKey> =
};

export function PlaygroundCredentialsDropdown() {
const currentProviders = usePlaygroundContext(
(state) => new Set(state.instances.map((instance) => instance.provider))
const currentProviders = usePlaygroundContext((state) =>
Array.from(new Set(state.instances.map((instance) => instance.provider)))
);
const setCredential = useCredentialsContext((state) => state.setCredential);
const credentials = useCredentialsContext((state) => state);
Expand All @@ -43,7 +43,7 @@ export function PlaygroundCredentialsDropdown() {
their respective API&apos;s.
</Text>
<Form>
{Array.from(currentProviders).map((provider) => {
{currentProviders.map((provider) => {
const credentialKey = ProviderToCredentialKeyMap[provider];
return (
<TextField
Expand Down

0 comments on commit fc8929e

Please sign in to comment.