From 32381fb58dc8ecdfee7541ff81380ebb31cd1192 Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Mon, 13 May 2024 11:14:53 +0300 Subject: [PATCH] chore: remove some 'TODO' comments (#1618) --- minifier/next_gen.ts | 1 - native/app/UI/Login.tsx | 2 +- native/app/core/ApiResponse.ts | 1 - native/app/core/BungieDefinitions.ts | 9 --------- native/app/inventory/logic/Sockets.ts | 12 ------------ native/app/inventory/logic/Transfer.ts | 1 - 6 files changed, 1 insertion(+), 25 deletions(-) diff --git a/minifier/next_gen.ts b/minifier/next_gen.ts index c6ebafa3e..684e6f559 100644 --- a/minifier/next_gen.ts +++ b/minifier/next_gen.ts @@ -107,7 +107,6 @@ function stripImageUrl(url: string): string { return shortUrl; } -// TODO: Update to retry a couple of times instead of failing right away async function downloadJsonFile(url: string): Promise { try { const response = await fetch(url); diff --git a/native/app/UI/Login.tsx b/native/app/UI/Login.tsx index 3fd5bdfa8..1500f552a 100644 --- a/native/app/UI/Login.tsx +++ b/native/app/UI/Login.tsx @@ -146,7 +146,7 @@ function LocalWebLogin() { ); } -export default function Login({ navigation }: { navigation: NavigationProp }) { +export default function Login({ navigation }: { readonly navigation: NavigationProp }) { const colorScheme = useColorScheme(); const authenticated = useGGStore((state) => state.authenticated); const createAuthenticatedAccount = useGGStore((state) => state.createAuthenticatedAccount); diff --git a/native/app/core/ApiResponse.ts b/native/app/core/ApiResponse.ts index 46f4a6f0b..808a52547 100644 --- a/native/app/core/ApiResponse.ts +++ b/native/app/core/ApiResponse.ts @@ -33,7 +33,6 @@ export type BungieManifest = Output; // Authenticated API Responses // ------------------------------- -// TODO: Should this also have 'Response'? export const bungieResponseSchema = object({ ErrorCode: number(), ErrorStatus: string(), diff --git a/native/app/core/BungieDefinitions.ts b/native/app/core/BungieDefinitions.ts index 04b713ce9..784368a47 100644 --- a/native/app/core/BungieDefinitions.ts +++ b/native/app/core/BungieDefinitions.ts @@ -151,7 +151,6 @@ export const StatGroupSchema = record( ), }), ), - // TODO: Fill in whatever this unknown is? overrides: unknown(), hash: number(), index: number(), @@ -163,13 +162,10 @@ export const StatGroupSchema = record( export const MiniStatGroupSchema = record( string(), object({ - // maximumValue: number(), - // uiPosition: number(), scaledStats: array( object({ statHash: number(), maximumValue: number(), - // displayAsNumeric: boolean(), displayInterpolation: array( object({ value: number(), @@ -178,12 +174,7 @@ export const MiniStatGroupSchema = record( ), }), ), - // TODO: Fill in whatever this unknown is? - // overrides: unknown(), - // hash: number(), - // index: number(), redacted: boolean(), - // blacklisted: boolean(), }), ); diff --git a/native/app/inventory/logic/Sockets.ts b/native/app/inventory/logic/Sockets.ts index 863a6e5fd..741e49fe4 100644 --- a/native/app/inventory/logic/Sockets.ts +++ b/native/app/inventory/logic/Sockets.ts @@ -67,7 +67,6 @@ enum IconType { Plug = 1, TopLevel = 2, } -// // TODO: Add values, I made these up // enum ModType { // Normal = 1, // Artifact = 2, @@ -80,7 +79,6 @@ export type SocketEntry = { iconType: IconType; // default is.Plug // modType: ModType; // default is.Normal - // TODO: The itemHash should not be here. SocketEntries are a type of destinyItem and maybe should be // extending that type? But right now it's not been needed. itemHash: number; plugSources: number; // This is a bitmask @@ -114,7 +112,6 @@ export type SocketEntry = { /// Used for perk objectives such as forge weapon materials and also kill counters // plugObjectiveValues: Record; - // TODO: Is this mode needed? It was in Ishtar // mode: .SocketEntry def?: DestinyItemDefinition; @@ -161,18 +158,12 @@ export function createSockets(destinyItem: DestinyItem): Sockets | null { addSocketCategoryDefinition(sockets); - // TODO: The categories now have an 'index' property gained from the definition. Should this be used - // to sort the visual order the categories are displayed in? - updateSocketEntriesWithLiveData(sockets, destinyItem); updateSocketCategoriesWithData(sockets, destinyItem); addDefinitionsToTopLevelSockets(sockets, destinyItem); - // TODO: addMasterworkInvestments() should be added. But it presumes addDefinitionsToTopLevelSockets has done - // it's job and right now some research is needed to see if it's really needed. - // TODO: addDeepsightResonance() should all be added. const p2 = performance.now(); console.log("createSockets", `${(p2 - p1).toFixed(4)} ms`); @@ -356,7 +347,6 @@ function updateSocketCategoriesWithData(sockets: Sockets, destinyItem: DestinyIt switch (plugSourceEnum) { case SocketPlugSources.InventorySourced: { - // TODO: Check if anything is using these. At one point shaders and mods did, but they seem to be in the api now. break; } case SocketPlugSources.ReusablePlugItems: { @@ -466,7 +456,6 @@ function addDefinitionsToTopLevelSockets(sockets: Sockets, _destinyItem: Destiny socketEntry.socketTypeHash = category.socketMaps[columnIndex]?.socketTypeHash ?? null; socketEntry.socketIndex = category.socketMaps[columnIndex]?.socketIndex ?? null; - // TODO: add back when this extends destinyItem? // socketEntry.itemInstanceId = destinyItem.itemInstanceId // let characterIdArg = ""; @@ -476,7 +465,6 @@ function addDefinitionsToTopLevelSockets(sockets: Sockets, _destinyItem: Destiny // } else { // characterIdArg = destinyItem.characterId; // } - // TODO: add back when this extends destinyItem? // socketEntry.characterId = characterIdArg } diff --git a/native/app/inventory/logic/Transfer.ts b/native/app/inventory/logic/Transfer.ts index bb517c04d..f8ab8392a 100644 --- a/native/app/inventory/logic/Transfer.ts +++ b/native/app/inventory/logic/Transfer.ts @@ -583,7 +583,6 @@ async function pullFromPostmaster(transferItem: TransferItem): Promise<[JSON, De membershipType, itemReferenceHash: transferItem.destinyItem.itemHash, itemId: transferItem.destinyItem?.itemInstanceId ? transferItem.destinyItem.itemInstanceId : "0", - // TODO: If the quantity is larger than can be moved should there be some logic to set it to the max possible? stackSize: transferItem.destinyItem.quantity, characterId: transferItem.destinyItem.characterId, };