fix: all commands now work with a lack of tankopedia entries

This commit is contained in:
TresAbhi committed 2023-07-07 01:08:00 +00:00
1 parent f907c79d68
commit ca208e44a1
12 files changed
+59 -26

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
import { tankopedia } from './tankopedia.js';
export default async function resolveTankName(tankId: number) {
const tankopediaName = (await tankopedia)[tankId].name;
const tankopediaName = (await tankopedia)[tankId]?.name;
return tankopediaName ? tankopediaName : `Unknown Tank ${tankId}`;
}
+1 -1
View File
@@ -13,7 +13,7 @@ export interface TankopediaEntry {
}
export interface Tankopedia {
[id: number]: TankopediaEntry;
[id: number]: TankopediaEntry | undefined;
}
console.log('Caching tankopedia...');