Skip to content

Commit 78ae83d

Browse files
committed
Fix normalized showing 0 when should be undefined
1 parent eb7227a commit 78ae83d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

renderer/src/web/price-check/trade/TradeItem.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
>{{ result.priceAmount }} {{ result.priceCurrency
1414
}}{{
1515
result.priceCurrency !== "exalted" &&
16-
result.priceCurrency !== "divine"
16+
result.priceCurrency !== "divine" &&
17+
result.normalizedPrice
1718
? ` (${result.normalizedPrice} ${
18-
result.normalizedPriceCurrency === "exalted"
19+
result.normalizedPriceCurrency! === "exalted"
1920
? "ex"
20-
: result.normalizedPriceCurrency === "chaos"
21+
: result.normalizedPriceCurrency! === "chaos"
2122
? "c"
22-
: result.normalizedPriceCurrency
23+
: result.normalizedPriceCurrency!
2324
})`
2425
: ""
2526
}}</span

renderer/src/web/price-check/trade/pathofexile-trade.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ export interface PricingResult {
296296
priceAmount: number;
297297
priceCurrency: string;
298298
priceCurrencyRank?: number;
299-
normalizedPrice: string;
300-
normalizedPriceCurrency: string;
299+
normalizedPrice?: string;
300+
normalizedPriceCurrency?: string;
301301
isMine: boolean;
302302
hasNote: boolean;
303303
isInstantBuyout: boolean;
@@ -991,13 +991,12 @@ export async function requestResults(
991991
currency: "exalted",
992992
}
993993
: // otherwise convert to stable
994-
(cachedCurrencyByQuery(query, result.listing.price?.amount ?? 0) ?? {
995-
min: 0,
996-
max: 0,
997-
currency: "exalted",
998-
});
999-
const normalizedPrice = displayRounding(normalizedCurrency.min);
1000-
const normalizedPriceCurrency = normalizedCurrency.currency;
994+
cachedCurrencyByQuery(query, result.listing.price?.amount ?? 0);
995+
const normalizedPrice =
996+
normalizedCurrency !== undefined
997+
? displayRounding(normalizedCurrency.min)
998+
: undefined;
999+
const normalizedPriceCurrency = normalizedCurrency?.currency;
10011000

10021001
return {
10031002
id: result.id,

0 commit comments

Comments
 (0)