Skip to content

Commit e2bd227

Browse files

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

scripts/community/inventory.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
return;
234234
}
235235

236-
LoadQuickSellInformation( element, commodityID, description, abortController.signal );
236+
LoadQuickSellInformation( element, commodityID, abortController.signal );
237237
} );
238238
}
239239

@@ -246,10 +246,9 @@
246246
/**
247247
* @param {HTMLElement} element
248248
* @param {string} commodityID
249-
* @param {any} description
250249
* @param {AbortSignal} signal
251250
*/
252-
function LoadQuickSellInformation( element, commodityID, description, signal )
251+
function LoadQuickSellInformation( element, commodityID, signal )
253252
{
254253
const histogramParams = new URLSearchParams();
255254
histogramParams.set( 'country', window.g_rgWalletInfo.wallet_country );
@@ -285,8 +284,6 @@
285284
return;
286285
}
287286

288-
const publisherFee = ( typeof description.market_fee !== 'undefined' && description.market_fee !== null ) ? description.market_fee : window.g_rgWalletInfo.wallet_publisher_fee_percent_default;
289-
290287
const hoverText = document.createElement( 'div' );
291288
hoverText.className = 'steamdb_orders_hover_text';
292289
hoverText.textContent = i18n.inventory_list_at.replace( '%price%', FormatCurrency( 0 ) );
@@ -306,8 +303,7 @@
306303
const str = isSellNow ? i18n.inventory_sell_at : i18n.inventory_list_at;
307304

308305
const price = Number.parseInt( button.dataset.price, 10 );
309-
const priceFees = window.CalculateFeeAmount( price, publisherFee );
310-
const priceAfterFees = price - priceFees.fees;
306+
const priceAfterFees = window.GetItemPriceFromTotal( price, window.g_rgWalletInfo );
311307

312308
hoverText.textContent = str.replace( '%price%', FormatCurrency( price ) );
313309

@@ -414,10 +410,11 @@
414410

415411
if( data.lowest_sell_order )
416412
{
417-
const undercutPrice = data.lowest_sell_order - 1;
418-
const undercutPriceFees = window.CalculateFeeAmount( undercutPrice, publisherFee );
413+
const nFloor = Number.parseInt( window.g_rgWalletInfo.wallet_market_minimum ?? 1, 10 );
414+
const nIncrement = Number.parseInt( window.g_rgWalletInfo.wallet_currency_increment ?? 1, 10 );
415+
const undercutPrice = data.lowest_sell_order - nIncrement;
419416

420-
if( undercutPrice - undercutPriceFees.fees > 0 && undercutPrice > data.highest_buy_order )
417+
if( undercutPrice >= ( 3 * nFloor ) && undercutPrice > data.highest_buy_order )
421418
{
422419
const row = document.createElement( 'tr' );
423420
row.classList.add( 'steamdb_order_row_clickable' );

0 commit comments

Comments
 (0)