fix: Stop button uses cancelling poll flow, shows status text during stop
Deploy LangGraph Server to Azure Web App / build-and-deploy (push) Failing after 35s
Deploy LangGraph UI to Azure Static Web Apps / build-and-deploy (push) Failing after 41s

This commit is contained in:
gongzhiyong
2026-04-12 16:45:36 +08:00
parent 1034d4bbc8
commit 004f26eb94
+18 -2
View File
@@ -1112,12 +1112,28 @@ function App() {
{thread.isLoading ? (
<button
type="button"
onClick={() => thread.stop()}
onClick={() => {
setConcurrentStatus("stopping");
wasStoppedRef.current = true;
thread.stop();
setTimeout(() => {
setConcurrentStatus("cancelling");
const waitForStop = () => {
if (!thread.isLoading) {
wasStoppedRef.current = false;
setConcurrentStatus("idle");
} else {
setTimeout(waitForStop, 200);
}
};
waitForStop();
}, 150);
}}
className="rounded-xl bg-destructive text-destructive-foreground px-4 py-2.5 text-sm font-medium hover:opacity-90 transition-opacity flex items-center gap-1.5"
title="点击停止生成"
>
<Square className="size-4 fill-current" />
停止
{concurrentStatus === "stopping" ? "停止中..." : concurrentStatus === "cancelling" ? "等待停止..." : "停止"}
</button>
) : (
<button