From e87f28747669a228b4c4f40b06391cc33d782208 Mon Sep 17 00:00:00 2001 From: JackEnx <167036558+JackEnx@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:37:50 -0300 Subject: [PATCH] refactor: remove redundant plataform validation --- src/main/services/process-watcher.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/services/process-watcher.ts b/src/main/services/process-watcher.ts index 573b4feb..f3f06109 100644 --- a/src/main/services/process-watcher.ts +++ b/src/main/services/process-watcher.ts @@ -67,12 +67,9 @@ const findGamePathByProcess = ( if (hasProcess) { for (const path of [...hasProcess]) { - const executableName = - process.platform === "win32" - ? executable.name.replace("/", "\\") - : executable.name; - - if (path.toLowerCase().endsWith(executableName)) { + if ( + path.toLowerCase().endsWith(executable.name.replace(/\//g, "\\")) + ) { gameRepository.update( { objectID: id, shop: "steam" }, { executablePath: path }