Skip to content

Commit

Permalink
refactor: Simplify primaryStat so its only a number (#1232)
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored Apr 12, 2024
1 parent 1f56534 commit 6c9e357
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion native/app/inventory/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export type DestinyIconData = {
characterId: string;
icon: string;
damageTypeIconUri: number | null;
primaryStat: string;
primaryStat: number;
quantity: number;
calculatedWaterMark: string | undefined;
masterwork: boolean;
Expand Down
2 changes: 1 addition & 1 deletion native/app/inventory/DestinyCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const DestinyCell = (props: DestinyCellProps) => {
{props.data.crafted && <Image source={CRAFTED_OVERLAY} cachePolicy="memory" style={styles.crafted} />}
</View>
</View>
{props.data.primaryStat !== "" && (
{props.data.primaryStat > 0 && (
<View style={styles.primaryStat}>
<Text style={styles.primaryStatText}>{props.data.primaryStat}</Text>
</View>
Expand Down
2 changes: 1 addition & 1 deletion native/app/inventory/EngramCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const EngramCell = (props: DestinyCellProps) => {
style={styles.frameSize}
recyclingKey={props.data?.icon}
/>
{props.data?.primaryStat !== "" && props.data?.primaryStat && (
{props.data?.primaryStat && props.data?.primaryStat > 0 && (
<View style={styles.primaryStat}>
<Text style={styles.powerLevelText}>{props.data?.primaryStat}</Text>
</View>
Expand Down
2 changes: 1 addition & 1 deletion native/app/store/AccountInventoryLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function returnVaultUiData(itemBuckets: number[], vaultData: VaultData): UISecti

function returnDestinyIconData(item: DestinyItem): DestinyIconData {
const damageTypeIconUri = getDamageTypeIconUri(item.damageType);
const primaryStat = item.primaryStat > 0 ? item.primaryStat.toString() : "";
const primaryStat = item.primaryStat;
const borderColor = returnBorderColor(item);
const masterwork = item.masterwork ?? false;
const crafted = item.crafted;
Expand Down

0 comments on commit 6c9e357

Please sign in to comment.