mirror of
https://github.com/coleam00/bolt.new-any-llm
synced 2024-12-28 06:42:56 +00:00
fix: provider menu dropdown fix (ghost providers) (#862)
Some checks are pending
Update Stable Branch / prepare-release (push) Waiting to run
Some checks are pending
Update Stable Branch / prepare-release (push) Waiting to run
This commit is contained in:
parent
7295352a98
commit
d8943f9474
@ -60,15 +60,18 @@ export function useSettings() {
|
|||||||
if (savedProviders) {
|
if (savedProviders) {
|
||||||
try {
|
try {
|
||||||
const parsedProviders: Record<string, IProviderSetting> = JSON.parse(savedProviders);
|
const parsedProviders: Record<string, IProviderSetting> = JSON.parse(savedProviders);
|
||||||
Object.keys(parsedProviders).forEach((provider) => {
|
Object.keys(providers).forEach((provider) => {
|
||||||
const currentProvider = providers[provider];
|
const currentProviderSettings = parsedProviders[provider];
|
||||||
|
|
||||||
|
if (currentProviderSettings) {
|
||||||
providersStore.setKey(provider, {
|
providersStore.setKey(provider, {
|
||||||
...currentProvider,
|
...providers[provider],
|
||||||
settings: {
|
settings: {
|
||||||
...parsedProviders[provider],
|
...currentProviderSettings,
|
||||||
enabled: parsedProviders[provider].enabled ?? true,
|
enabled: currentProviderSettings.enabled ?? true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to parse providers from cookies:', error);
|
console.error('Failed to parse providers from cookies:', error);
|
||||||
|
Loading…
Reference in New Issue
Block a user