summaryrefslogtreecommitdiffstats
path: root/ui/index.js
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-07-23 17:41:49 -0700
committeryum <yum.food.vr@gmail.com>2025-07-23 17:41:49 -0700
commit790c91d7ad515c3c0a22ca1341316265b8f0d779 (patch)
tree28527bbcf87e8fab1d27eb76a1f5ea325b94d599 /ui/index.js
parent73de7cb2d8fb964e7f76ab55420e9bc331bf7bea (diff)
bugfixes
* fix model acquisition * fix local beepsnd * fix volume control
Diffstat (limited to 'ui/index.js')
-rw-r--r--ui/index.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/ui/index.js b/ui/index.js
index 24a7e13..5a5d0a6 100644
--- a/ui/index.js
+++ b/ui/index.js
@@ -530,19 +530,20 @@ ipcMain.handle('start-process', async () => {
});
ipcMain.handle('stop-process', async () => {
+ if (!runningProcess) {
+ sendPythonOutput('No process to stop', 'info');
+ return { success: true, forcefullyKilled: false };
+ }
+
return new Promise((resolve) => {
let forcefullyKilled = false;
-
- if (!runningProcess) {
- resolve({ success: true, forcefullyKilled });
- }
// Set up a timeout to force kill after 10 seconds
const killTimeout = setTimeout(() => {
if (runningProcess) {
sendPythonOutput('Process did not stop gracefully, forcing termination...', 'stderr');
forcefullyKilled = true;
- runningProcess.kill();
+ runningProcess.kill('SIGKILL');
}
}, 10000);
@@ -562,10 +563,14 @@ ipcMain.handle('stop-process', async () => {
// Send termination signal
sendPythonOutput('Stopping process gracefully...', 'info');
- runningProcess.kill();
+ runningProcess.kill('SIGTERM');
});
});
+ipcMain.handle('get-process-state', () => {
+ return { isRunning: runningProcess !== null };
+});
+
// Clean up on app quit
app.on('before-quit', () => {
if (runningProcess) {