From 4b38ce3c310accd7cafb7f7f5fa8abeede4efbb4 Mon Sep 17 00:00:00 2001 From: que01 Date: Thu, 3 Sep 2026 11:28:49 +0800 Subject: [PATCH] fix(workbench): require explicit junction draft exit --- workbench/client/src/App.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/workbench/client/src/App.tsx b/workbench/client/src/App.tsx index 887c057..53dcf45 100644 --- a/workbench/client/src/App.tsx +++ b/workbench/client/src/App.tsx @@ -705,9 +705,11 @@ function App() { }; const closeJunction = () => { if (junctionSession?.dirty) { - const choice = window.confirm('路口有未应用草稿。确定放弃并返回主地图吗?'); - if (!choice) return; - setJunctionSession(cancelJunctionSession(junctionSession)); + const choice = window.prompt('路口有未应用草稿:输入 1 应用并返回,2 放弃并返回,3 留在工作区', '3'); + if (choice === '3' || !choice) return; + if (choice === '1') setJunctionSession(applyJunctionDraft(junctionSession)); + else if (choice === '2') setJunctionSession(cancelJunctionSession(junctionSession)); + else return; } window.history.pushState({}, '', '/'); setJunctionRoute(null);