close window by esc

This commit is contained in:
pompurin404 2024-08-24 16:58:41 +08:00
parent be04031e82
commit 066475237e
No known key found for this signature in database
3 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,9 @@
### New Features
- 支持删除 Webdav 备份文件
- Esc关闭窗口
### Bug Fixes
- 修复拨号网络系统代理问题
- 尝试修复部分白屏问题

View File

@ -137,7 +137,9 @@ export function createWindow(show = false): void {
mainWindow?.focusOnWebView()
}
})
mainWindow.webContents.on('did-fail-load', () => {
mainWindow?.webContents.reload()
})
mainWindow.on('resize', () => {
mainWindow?.webContents.send('resize')
})

View File

@ -19,6 +19,10 @@ init().then(() => {
e.preventDefault()
quitApp()
}
if (e.key === 'Escape') {
e.preventDefault()
window.close()
}
})
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>