From e358d602609efaae35a6ceb701e078137516067b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 16 Jul 2024 22:44:14 +0300 Subject: [PATCH] Prevent corrupted page sizes for market listings Fixes #200 --- code.user.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code.user.js b/code.user.js index 40b6347..20c8fc7 100644 --- a/code.user.js +++ b/code.user.js @@ -2915,6 +2915,12 @@ $('.market_listing_table_header', market_listing_see.parent()) .append(''); + let pageSize = parseInt(getSettingWithDefault(SETTING_MARKET_PAGE_COUNT), 10); + + if (isNaN(pageSize) || pageSize < 1) { + pageSize = settingDefaults[SETTING_MARKET_PAGE_COUNT]; + } + var options = { valueNames: [ 'market_listing_game_name', 'market_listing_item_name_link', 'market_listing_price', @@ -2938,7 +2944,7 @@ left: 100, right: 100 }], - page: parseInt(getSettingWithDefault(SETTING_MARKET_PAGE_COUNT)) + page: pageSize, }; var list = new List(market_listing_see.parent().attr('id'), options); @@ -3576,7 +3582,7 @@ '
' + '' + '
' + - 'Hours to use for the average history calculated price: ' + + 'Hours to use for the average history calculated price: ' + '
' + '
' + 'The value to add to the calculated price (minimum and maximum are respected): ' + @@ -3616,7 +3622,7 @@ '
' + '
' + '
' + - 'Market items per page: ' + + 'Market items per page: ' + '
' + '
' + 'Automatically relist overpriced market listings (slow on large inventories): ' +