Skip to content

Commit

Permalink
fix: Global items should only show a vault transfer button (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored Apr 13, 2024
1 parent b9fa589 commit 7fbf600
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions native/app/screens/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { DestinyItem } from "@/app/bungie/Types.ts";
import { itemTypeDisplayName, itemsDefinition } from "@/app/store/Definitions.ts";
import { useGGStore } from "@/app/store/GGStore.ts";
import { processTransferItem } from "@/app/transfer/TransferLogic.ts";
import { VAULT_CHARACTER_ID } from "@/app/utilities/Constants.ts";
import { GLOBAL_INVENTORY_NAMES, VAULT_CHARACTER_ID } from "@/app/utilities/Constants.ts";
import type { NavigationProp, RouteProp } from "@react-navigation/native";
import { Image } from "expo-image";
import { useEffect, useRef, useState } from "react";
Expand Down Expand Up @@ -113,6 +113,13 @@ function TransferEquipButtons(props: TransferEquipButtonsProps) {
}

for (const ggCharacter of ggCharacters) {
// Global items can only be transferred to the vault
if (GLOBAL_INVENTORY_NAMES.includes(props.destinyItem.characterId)) {
if (ggCharacter.characterId !== VAULT_CHARACTER_ID) {
continue;
}
}

const isTransferDisabled = calcTransferButtonDisabled(ggCharacter.characterId);
const isEquipDisabled = calcEquipButtonDisabled(ggCharacter.characterId);

Expand All @@ -136,7 +143,6 @@ function TransferEquipButtons(props: TransferEquipButtonsProps) {
});

rectangles.push(
// style should make this a flex row
<GestureHandlerRootView key={ggCharacter.characterId} style={{ flexDirection: "row", gap: 5 }}>
<GestureDetector gesture={transferTap}>
<View
Expand Down

0 comments on commit 7fbf600

Please sign in to comment.