fix: Game list not being updated

* fix game list not being updated, when games are removed when the launcher is closed.
* add vs files to the gitignore file.
This commit is contained in:
Exhigh
2025-11-25 19:39:33 +04:00
parent 235ebad132
commit a3d6934b8c
2 changed files with 11 additions and 0 deletions

1
.gitignore vendored
View File

@@ -23,5 +23,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.vs
.env

View File

@@ -148,9 +148,12 @@ async function scanDirectory(
return;
}
const children = await readDir(path);
let tempKnownPaths = new Set<string>(knownPaths);
for (const c of children) {
if (c.isDirectory) {
const childPath = await join(path, c.name);
tempKnownPaths.delete(childPath);
await scanDirectory(
childPath,
knownPaths,
@@ -159,6 +162,13 @@ async function scanDirectory(
);
}
}
tempKnownPaths.forEach((path) => {
unregisterGamePathPrefix(
path,
knownPaths,
);
});
} catch (e: unknown) {
console.error(`Error discovering game at "${path}"`, e);
}