MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handleCheck

Function handleCheck

packages/react/src/components/accounts-section.tsx:100–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98 const missingOAuthScopes = connection.missingOAuthScopes ?? [];
99
100 const handleCheck = async () => {
101 if (checking) return;
102 setChecking(true);
103 const exit = await runCheck();
104 setChecking(false);
105 if (Exit.isFailure(exit)) {
106 toast.error(messageFromExit(exit, "Health check failed"));
107 return;
108 }
109 // The hook already folded the fresh probe into the live state.
110 if (exit.value.status === "healthy") {
111 toast.success(
112 exit.value.identity ? `Healthy: ${exit.value.identity}` : "Connection is healthy",
113 );
114 } else if (exit.value.status === "expired") {
115 toast.error("Connection expired, reconnect to restore access");
116 } else if (exit.value.status === "degraded") {
117 toast.warning(exit.value.detail ?? "Connection check returned an error");
118 } else {
119 toast.message("No health check is configured for this integration");
120 }
121 };
122
123 return (
124 <CardStackEntry className="flex-wrap items-start">

Callers 1

AccountRowFunction · 0.85

Calls 3

messageFromExitFunction · 0.90
errorMethod · 0.80
messageMethod · 0.45

Tested by

no test coverage detected