From b7cf195907df6c2ae6deb214499ca7bd69a4e820 Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Mon, 1 Apr 2024 13:27:16 +0200 Subject: [PATCH 1/2] feat: Use item finder --- native/app/screens/BottomSheet.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/native/app/screens/BottomSheet.tsx b/native/app/screens/BottomSheet.tsx index 7597cdb4e..90b5e0c8f 100644 --- a/native/app/screens/BottomSheet.tsx +++ b/native/app/screens/BottomSheet.tsx @@ -2,7 +2,7 @@ import type { DestinyCell } from "@/app/inventory/Common.ts"; import { itemTypeDisplayName, itemsDefinition } from "@/app/store/Definitions.ts"; import { useGGStore } from "@/app/store/GGStore.ts"; import { itemSchema } from "@/app/store/Types"; -import type { TransferItem } from "@/app/transfer/TransferLogic.ts"; +import { findDestinyItem, type TransferItem } from "@/app/transfer/TransferLogic.ts"; import type { NavigationProp, RouteProp } from "@react-navigation/native"; import { Image } from "expo-image"; import { useEffect, useRef, useState } from "react"; @@ -122,6 +122,11 @@ export default function BottomSheet({ } }, []); + const p1 = performance.now(); + const destinyItem = findDestinyItem(itemInstanceId, itemHash); + const p2 = performance.now(); + console.log("findDestinyItem", `${(p2 - p1).toFixed(4)} ms`); + function transferItem( toCharacterId: string, itemInstanceId: string | undefined, From bdd277750fc01f2ce340e95d480cd1d8c9d9f11c Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Mon, 1 Apr 2024 13:30:23 +0200 Subject: [PATCH 2/2] Lint fix --- native/app/screens/BottomSheet.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/app/screens/BottomSheet.tsx b/native/app/screens/BottomSheet.tsx index 90b5e0c8f..57ccc1764 100644 --- a/native/app/screens/BottomSheet.tsx +++ b/native/app/screens/BottomSheet.tsx @@ -125,7 +125,7 @@ export default function BottomSheet({ const p1 = performance.now(); const destinyItem = findDestinyItem(itemInstanceId, itemHash); const p2 = performance.now(); - console.log("findDestinyItem", `${(p2 - p1).toFixed(4)} ms`); + console.log("findDestinyItem", destinyItem.equipped, `${(p2 - p1).toFixed(4)} ms`); function transferItem( toCharacterId: string,