fix: Wait for all MCP Servers Health Checks to load

This commit is contained in:
Aleksander Grygier 2026-01-26 15:38:10 +01:00
parent 82f26ad8e4
commit 1d518cac06
1 changed files with 8 additions and 5 deletions

View File

@ -8,6 +8,13 @@
import { McpServerCard, McpServerForm } from '$lib/components/app/mcp';
import { Skeleton } from '$lib/components/ui/skeleton';
let servers = $derived(mcpStore.getServersSorted());
let allServersHealthChecked = $derived(
servers.length > 0 &&
servers.every((server) => {
const state = mcpStore.getHealthCheckState(server.id);
return state.status === 'success' || state.status === 'error';
})
);
let isAddingServer = $state(false);
let newServerUrl = $state('');
@ -111,11 +118,7 @@
{#if servers.length > 0}
<div class="space-y-3">
{#each servers as server (server.id)}
{@const healthState = mcpStore.getHealthCheckState(server.id)}
{@const isServerLoading =
healthState.status === 'idle' || healthState.status === 'connecting'}
{#if isServerLoading}
{#if !allServersHealthChecked}
<Card.Root class="grid gap-3 p-4">
<div class="flex items-center justify-between gap-4">
<div class="flex items-center gap-2">