Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

967 B
Raw Blame
// Appearance-flag resolution for the home dashboard.
//
// Regression context (#4596 → restored here): the home provider-topology card
// (the ReactFlow connection map) defaults ON — the AppearanceTab toggle reads it
// as `settings.showProviderTopologyOnHome !== false`. #4596 made HomePageClient
// initialize the flag to `false` and only flip it when the API returned an
// explicit boolean, so any install that never persisted the setting (the common
// case → the field is `undefined`) kept the card hidden forever, contradicting
// the AppearanceTab toggle. This helper centralizes the default-ON semantics so
// both surfaces agree: absent ⇒ show, explicit `false` ⇒ hide, explicit `true` ⇒ show.

/**
 * Whether the home provider-topology card should render.
 * Defaults ON; only an explicit `false` hides it (mirrors AppearanceTab).
 */
export function shouldShowProviderTopologyOnHome(setting: unknown): boolean {
  return setting !== false;
}