Skip to content

Commit bdd4854

Browse files
committed
refactor: when accepting offer cancel listing before accepting the offer
1 parent 309d9bb commit bdd4854

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/components/AcceptOfferForm/index.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,10 @@ const AcceptOfferForm = ({
7878
return
7979
}
8080

81-
let newActions: Action[] = [
82-
{
83-
name: 'Accepting offer...',
84-
id: 'acceptOffer',
85-
action: onAcceptOffer,
86-
param: undefined,
87-
},
88-
]
81+
let newActions: Action[] = []
8982

9083
if (listing) {
9184
newActions = [
92-
...newActions,
9385
{
9486
name: 'Cancel previous listing...',
9587
id: 'cancelListing',
@@ -99,6 +91,16 @@ const AcceptOfferForm = ({
9991
]
10092
}
10193

94+
newActions = [
95+
...newActions,
96+
{
97+
name: 'Accepting offer...',
98+
id: 'acceptOffer',
99+
action: onAcceptOffer,
100+
param: undefined,
101+
},
102+
]
103+
102104
await runActions(newActions, {
103105
onActionSuccess: async () => {
104106
toast.success('The transaction was confirmed.')

0 commit comments

Comments
 (0)