refactor: move executable name replate outside the forof

This commit is contained in:
JackEnx 2024-12-16 16:42:07 -03:00
parent e87f287476
commit 5607f6d524

View file

@ -66,10 +66,10 @@ const findGamePathByProcess = (
const hasProcess = processMap.get(exe);
if (hasProcess) {
const executableName = executable.name.replace(/\//g, "\\");
for (const path of [...hasProcess]) {
if (
path.toLowerCase().endsWith(executable.name.replace(/\//g, "\\"))
) {
if (path.toLowerCase().endsWith(executableName)) {
gameRepository.update(
{ objectID: id, shop: "steam" },
{ executablePath: path }