mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-21 08:13:34 +00:00
fix(dev-host): close debug pages without a confirmation modal
Closing a workbench page popped a centered confirm dialog that locked the entire shell (busy gate) until answered. Developers who clicked the tab's close button and immediately went for the connection list found every button dead and reported the page as impossible to reopen. Debug pages are stateless and rebuild on reopen, so the close now happens immediately; destructive actions (delete connection, disconnect, backend rebuild) keep their confirmations.
This commit is contained in:
@@ -257,7 +257,9 @@ function removeFrames(connectionId) {
|
||||
}
|
||||
async function closeFrame(frame) {
|
||||
await run(async () => {
|
||||
if (!(await ask("关闭此页面?未保存修改将丢失;最后一个关联页面关闭后会断开连接。"))) return;
|
||||
// Closing a debug page is cheap — the plugin UI is stateless and rebuilds
|
||||
// on reopen — so it closes immediately instead of behind a modal that
|
||||
// locks the whole shell until answered.
|
||||
connections.value = (await api("frames/close", { id: frame.id })).connections;
|
||||
windows.delete(frame.id);
|
||||
frames.value = frames.value.filter((f) => f.id !== frame.id);
|
||||
|
||||
Reference in New Issue
Block a user