fix(workbench): require explicit junction draft exit
This commit is contained in:
1 parent
c59fb704ef
commit
4b38ce3c31
1 file changed
+5
-3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user