返回提交历史
Modified
src/controllers/stats/viewController.ts
+9
-1
XFEstudio/XFESpaceNinjaServer
chore: improve unlockAllScans's handling of existing scans (#1875)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1875 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
5cda2e2d
代码差异
1 个文件
+9
-1
@@ -27,7 +27,15 @@ const viewController: RequestHandler = async (req, res) => {
27
27
for (const type of Object.keys(ExportEnemies.avatars)) {
28
28
if (!scans.has(type)) scans.add(type);
29
29
}
30
responseJson.Scans ??= [];
30
31
// Take any existing scans and also set them to 9999
32
if (responseJson.Scans) {
33
for (const scan of responseJson.Scans) {
34
scans.add(scan.type);
35
}
36
}
37
responseJson.Scans = [];
38
31
39
for (const type of scans) {
32
40
responseJson.Scans.push({ type: type, scans: 9999 });
33
41
}