添加应用退出功能,支持通过长按触摸事件触发退出
This commit is contained in:
@@ -39,7 +39,8 @@ function App() {
|
||||
|
||||
const handleTouchStart = () => {
|
||||
restartTimerRef.current = window.setTimeout(() => {
|
||||
window.electronAPI.restartApp();
|
||||
// 长按 5 秒改为关闭应用
|
||||
window.electronAPI.quitApp();
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
|
||||
1
src/electron.d.ts
vendored
1
src/electron.d.ts
vendored
@@ -28,6 +28,7 @@ interface ElectronAPI {
|
||||
log: (level: string, message: any) => void;
|
||||
removeIdCardListeners: () => void;
|
||||
restartApp: () => void;
|
||||
quitApp: () => void;
|
||||
}
|
||||
|
||||
interface Window {
|
||||
|
||||
Reference in New Issue
Block a user