Skip to content

Commit c1c8fc2

Browse files
committed
Use clearError in makeRequest
1 parent 7a35078 commit c1c8fc2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

client/src/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
Hash,
3838
MessageSquare,
3939
Send,
40-
Terminal
40+
Terminal,
4141
} from "lucide-react";
4242

4343
import { toast } from "react-toastify";
@@ -72,10 +72,6 @@ const App = () => {
7272
prompts: null,
7373
tools: null,
7474
});
75-
76-
const clearError = (tabKey: keyof typeof errors) => {
77-
setErrors((prev) => ({ ...prev, [tabKey]: null }));
78-
};
7975
const [command, setCommand] = useState<string>(() => {
8076
return localStorage.getItem("lastCommand") || "mcp-server-everything";
8177
});
@@ -210,6 +206,10 @@ const App = () => {
210206
]);
211207
};
212208

209+
const clearError = (tabKey: keyof typeof errors) => {
210+
setErrors((prev) => ({ ...prev, [tabKey]: null }));
211+
};
212+
213213
const makeRequest = async <T extends ZodType<object>>(
214214
request: ClientRequest,
215215
schema: T,
@@ -224,7 +224,7 @@ const App = () => {
224224
pushHistory(request, response);
225225

226226
if (tabKey !== undefined) {
227-
setErrors((prev) => ({ ...prev, [tabKey]: null }));
227+
clearError(tabKey);
228228
}
229229

230230
return response;

0 commit comments

Comments
 (0)