Skip to content

Commit

Permalink
fix: abort scan feature
Browse files Browse the repository at this point in the history
  • Loading branch information
joshualai9922 committed Jun 6, 2024
1 parent cf84ae7 commit b4868d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion public/electron/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contextBridge.exposeInMainWorld("services", {
const results = await ipcRenderer.invoke("startScan", scanDetails);
return results;
},
abortScan: async (scanDetails) => {
abortScan: async () => {
await ipcRenderer.invoke("abortScan");
},

Expand Down
8 changes: 4 additions & 4 deletions public/electron/scanManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ const validateUrlConnectivity = async (scanDetails) => {

const response = await new Promise(async (resolve) => {
const check = spawn(
"npm",
["-C", enginePath, "run", "cli", "--", ...getScanOptions(scanDetails)],
"node",
[`${enginePath}/dist/cli.js`, ...getScanOptions(scanDetails)],
{
cwd: resultsPath,
env: {
Expand Down Expand Up @@ -193,8 +193,8 @@ const startScan = async (scanDetails, scanEvent) => {
const response = await new Promise(async (resolve) => {
let intermediateFolderName;
const scan = spawn(
"npm",
["-C", enginePath, "run", "cli", "--", ...getScanOptions(scanDetails)],
"node",
[`${enginePath}/dist/cli.js`, ...getScanOptions(scanDetails)],
{
cwd: resultsPath,
env: {
Expand Down
5 changes: 0 additions & 5 deletions src/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ const validateUrlConnectivity = async (scanDetails) => {
return response;
};

const abortScan = async () => {
await window.services.abortScan()
};

const startScan = async (scanDetails) => {
const {
scanType: selectedScanType,
Expand Down Expand Up @@ -240,7 +236,6 @@ const isValidName = (name) => {
};

const services = {
abortScan,
startScan,
openReport,
getResultsFolderPath,
Expand Down

0 comments on commit b4868d0

Please sign in to comment.