Skip to content

Commit a32cd26

Browse files
authored
fix(providers): validate configured providers only (#656)
1 parent 4154cb8 commit a32cd26

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

packages/stage-ui/src/stores/providers.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,16 +1779,18 @@ export const useProvidersStore = defineStore('providers', () => {
17791779
// Initialize all providers
17801780
Object.keys(providerMetadata).forEach(initializeProvider)
17811781

1782-
// Update configuration status for all providers
1782+
// Update configuration status for all configured providers
17831783
async function updateConfigurationStatus() {
1784-
await Promise.all(Object.keys(providerMetadata).map(async (providerId) => {
1785-
try {
1786-
configuredProviders.value[providerId] = await validateProvider(providerId)
1787-
}
1788-
catch {
1789-
configuredProviders.value[providerId] = false
1790-
}
1791-
}))
1784+
await Promise.all(Object.entries(providerMetadata)
1785+
.filter(([_, v]) => v.configured)
1786+
.map(async ([providerId]) => {
1787+
try {
1788+
configuredProviders.value[providerId] = await validateProvider(providerId)
1789+
}
1790+
catch {
1791+
configuredProviders.value[providerId] = false
1792+
}
1793+
}))
17921794
}
17931795

17941796
// Call initially and watch for changes

0 commit comments

Comments
 (0)