diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 9e7e6cea..487a2e85 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -361,7 +361,7 @@ export const addSentinel = async (sentinelName: string, accountId: string) => { export const addPowerSuit = async (powersuitName: string, accountId: string): Promise => { const specialItems = getExalted(powersuitName); - if (specialItems != false) { + if (specialItems) { for await (const specialItem of specialItems) { await addSpecialItem(specialItem, accountId); } @@ -374,7 +374,7 @@ export const addPowerSuit = async (powersuitName: string, accountId: string): Pr export const addMechSuit = async (mechsuitName: string, accountId: string) => { const specialItems = getExalted(mechsuitName); - if (specialItems != false) { + if (specialItems) { for await (const specialItem of specialItems) { await addSpecialItem(specialItem, accountId); } diff --git a/src/services/itemDataService.ts b/src/services/itemDataService.ts index 3bf039dd..33d7064b 100644 --- a/src/services/itemDataService.ts +++ b/src/services/itemDataService.ts @@ -45,16 +45,11 @@ export const getRecipe = (uniqueName: string): IRecipe | undefined => { return ExportRecipes[uniqueName]; }; -export const getExalted = (uniqueName: string) => { - const suit = getSuitByUniqueName(uniqueName); - if (suit?.exalted !== undefined) { - return suit.exalted; - } else { - return false; - } +export const getExalted = (uniqueName: string): string[] | undefined => { + return getSuitByUniqueName(uniqueName)?.exalted; }; -export const getItemCategoryByUniqueName = (uniqueName: string) => { +export const getItemCategoryByUniqueName = (uniqueName: string): string => { //Lotus/Types/Items/MiscItems/PolymerBundle let splitWord = "Items/";