Skip to content

Commit

Permalink
Merge pull request #310 from Build-Squad/minor-fixes-prod
Browse files Browse the repository at this point in the history
Fix duplicate order completion notification in confirm escrow
  • Loading branch information
muditmahajan authored Apr 8, 2024
2 parents a659059 + addd959 commit 350e46f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/api/marketplace/orders/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def confirm_escrow(order_id: str):

val_auth_keypair, _ = get_local_keypair_pubkey(path=VALIDATOR_KEY_PATH)

if escrow.status == 'cancelled' or escrow.status == 'delivered':
return False

on_chain_transaction = OnChainTransaction.objects.create(
escrow=escrow, transaction_type='confirm_escrow'
)
Expand Down Expand Up @@ -175,7 +178,7 @@ def confirm_escrow(order_id: str):

on_chain_transaction.save()

if on_chain_transaction.is_confirmed:
if on_chain_transaction.is_confirmed and order.status != 'completed':
order.status = 'completed'
order.save()

Expand Down
2 changes: 0 additions & 2 deletions src/ui/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ const userPersistConfig = {
storage: storage,
whitelist: ["user"],
blacklist: ["navigation"],
timeout: 1000,
};

const cartPersistConfig = {
key: "cart",
storage: storage,
whitelist: ["cart"],
blacklist: ["navigation"],
timeout: 1000,
};

const persistedUserReducer = persistReducer(
Expand Down

0 comments on commit 350e46f

Please sign in to comment.