@@ -68,7 +68,7 @@ export function MyListingsTable({ address, selectedIds = [], onSelectionChange }
6868 }
6969 } , [ queryClient , allPodListings , allMarket , farmerMarket , onSelectionChange ] ) ;
7070
71- const { writeWithEstimateGas, submitting } = useTransaction ( {
71+ const { writeWithEstimateGas, submitting, setSubmitting } = useTransaction ( {
7272 successMessage : "Listing(s) cancelled successfully" ,
7373 errorMessage : "Failed to cancel listing(s)" ,
7474 successCallback : onCancelSuccess ,
@@ -82,6 +82,7 @@ export function MyListingsTable({ address, selectedIds = [], onSelectionChange }
8282 return ;
8383 }
8484
85+ setSubmitting ( true ) ;
8586 setCancellingIds ( ( prev ) => new Set ( prev ) . add ( listing . id ) ) ;
8687
8788 try {
@@ -97,14 +98,15 @@ export function MyListingsTable({ address, selectedIds = [], onSelectionChange }
9798 args : [ 0n , TokenValue . fromBlockchain ( listing . index , PODS . decimals ) . toBigInt ( ) ] ,
9899 } ) ;
99100 } finally {
101+ setSubmitting ( false ) ;
100102 setCancellingIds ( ( prev ) => {
101103 const next = new Set ( prev ) ;
102104 next . delete ( listing . id ) ;
103105 return next ;
104106 } ) ;
105107 }
106108 } ,
107- [ address , diamondAddress , writeWithEstimateGas ] ,
109+ [ address , diamondAddress , writeWithEstimateGas , setSubmitting ] ,
108110 ) ;
109111
110112 // Handle immediate bulk cancel
@@ -122,6 +124,8 @@ export function MyListingsTable({ address, selectedIds = [], onSelectionChange }
122124 return ;
123125 }
124126
127+ setSubmitting ( true ) ;
128+
125129 try {
126130 trackSimpleEvent ( ANALYTICS_EVENTS . MARKET . POD_LIST_CANCEL , {
127131 listing_count : ownedListings . length ,
@@ -141,8 +145,10 @@ export function MyListingsTable({ address, selectedIds = [], onSelectionChange }
141145 } ) ;
142146 } catch ( error ) {
143147 console . error ( "Batch cancel failed:" , error ) ;
148+ } finally {
149+ setSubmitting ( false ) ;
144150 }
145- } , [ address , listings , selectedIds , diamondAddress , writeWithEstimateGas ] ) ;
151+ } , [ address , listings , selectedIds , diamondAddress , writeWithEstimateGas , setSubmitting ] ) ;
146152
147153 // Compute visible listings on current page for select all logic
148154 const visibleListings = listings ?. slice ( newestEventOnPage , oldestEventOnPage + 1 ) || [ ] ;
0 commit comments