Skip to content

Commit

Permalink
Restricts Inventory Picker If Previously Sent Non-Active Offer
Browse files Browse the repository at this point in the history
  • Loading branch information
Step7750 committed May 5, 2024
1 parent 108731a commit 978a453
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 978a453

Please sign in to comment.