Skip to content

Commit

Permalink
Accept if not declined at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Mar 20, 2021
1 parent dd8c73b commit 3e36126
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion app/src/trading/logic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ import checkSides from './checkSides';
import unmarketable from './unmarketable';
import calculatePrices from './calculatePrices';
import checkOverpay from './checkOverpay';
import { Middleware, OfferContext } from '../pipeline';

export default [glitched, isOwner, checkSides, unmarketable, calculatePrices, checkOverpay];
function thenAccept(context: OfferContext) {
const { processor, offer } = context;
processor.accept(offer);
}

const logic: Middleware[] = [glitched, isOwner, checkSides, unmarketable, calculatePrices, checkOverpay, thenAccept];

export default logic;
1 change: 0 additions & 1 deletion app/src/trading/pipeline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Account from '../account/account';
import { Offer, ItemPrice } from './types';
import Processor from './processor';

Expand Down

0 comments on commit 3e36126

Please sign in to comment.