From 220c6bf86c1a672b97b08b39aed554146e3ea030 Mon Sep 17 00:00:00 2001 From: Daniel Dabek Date: Mon, 10 Feb 2020 16:22:36 -0500 Subject: [PATCH] update process kill on mining stop --- src/components/primary/full/home.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/primary/full/home.js b/src/components/primary/full/home.js index cf5078c..c863333 100644 --- a/src/components/primary/full/home.js +++ b/src/components/primary/full/home.js @@ -118,10 +118,24 @@ export default class Home extends React.Component { hashrate: 0 })); - console.log(this.state.xmrig_pid); - spawn('killall', ['xmrig-osx']); + if (window.process.platform === 'darwin') { + console.log("entered darwin"); + console.log(this.state.xmrig_pid); + spawn('killall', ['xmrig-osx']); + + console.log("Mining was stopped"); + } else if (window.process.platform === 'linux') { + console.log(this.state.xmrig_pid); + spawn('killall', ['xmrig-linux']); + + console.log("Mining was stopped"); + } else if (window.process.platform === 'win32') { + console.log(this.state.xmrig_pid); + spawn('killall', ['xmrig-win.exe']); + + console.log("Mining was stopped"); + } - console.log("Mining was stopped"); }; check_mining_status = async () => {