Skip to content

Commit

Permalink
Merge pull request #225 from csfloat/fix/stricter-inventory-picker-re…
Browse files Browse the repository at this point in the history
…strictions

Restricts Inventory Picker If Previously Sent Non-Active Offer
  • Loading branch information
Step7750 authored May 5, 2024
2 parents 108731a + 978a453 commit f0c9af9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/components/trade_offer/auto_fill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ export class AutoFill extends FloatElement {

const tradesToBuyer = this.pendingTradesResponse.trades.filter((e) => e.buyer_id === UserThem?.strSteamId);

const tradesWithoutOffersToBuyer = tradesToBuyer.filter((e) => !e.steam_offer?.state || !e.steam_offer?.id);
const tradesWithoutOffersToBuyer = tradesToBuyer.filter(
(e) => !e.steam_offer?.state || !e.steam_offer?.id || ![2, 3].includes(e.steam_offer?.state) // 2, 3 correspond to "active" and "accepted" trade offers
);
if (tradesWithoutOffersToBuyer.length > 0 || hasQueryParameter('autofill')) {
// Disable them being able to select random items from their inventory (ensure asset IDs match up)
this.disableInventoryPicker();
Expand Down

0 comments on commit f0c9af9

Please sign in to comment.