Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: prevent internal onChange from re-initializing fallback groups

Yuneng Jiang7d3c0b1cacd0
diff --git a/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx b/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx
index 18c5d52b4f7..b1bcf3029b3 100644
--- a/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx
+++ b/ui/litellm-dashboard/src/components/common_components/RouterSettingsAccordion.tsx
@@ -92,17 +92,13 @@ const RouterSettingsAccordion = forwardRef<RouterSettingsAccordionRef, RouterSet
})
: null;
- // Skip if this is an internal update (from our own onChange) and the value hasn't actually changed
- if (isInternalUpdateRef.current && valueKey === lastInitializedValueRef.current) {
+ // Skip if this is an internal update (from our own onChange)
+ if (isInternalUpdateRef.current) {
isInternalUpdateRef.current = false;
+ lastInitializedValueRef.current = valueKey;
return;
}
- // Reset the flag if value actually changed externally
- if (isInternalUpdateRef.current && valueKey !== lastInitializedValueRef.current) {
- isInternalUpdateRef.current = false;
- }
-
// Only update if the value actually changed from an external source
if (valueKey === lastInitializedValueRef.current) {
return;