mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
fix(marketplace): reset creditsWaiting after redeeming sold offers
redeemSoldOffers optimistically removed the sold offers but never reset creditsWaiting, so the redeem panel (gated on creditsWaiting > 0) kept rendering "get 0 sold items for N credits" with an active Redeem button until the server re-pushed the offers. Reset creditsWaiting to 0 on redeem.
This commit is contained in:
+4
@@ -67,6 +67,10 @@ export const CatalogLayoutMarketplaceOwnItemsView: FC<CatalogLayoutProps> = prop
|
||||
return prevValue.filter(value => (idsToDelete.indexOf(value.offerId) === -1));
|
||||
});
|
||||
|
||||
// Without this the redeem panel stays visible (creditsWaiting > 0) after
|
||||
// the sold offers are optimistically removed, showing "get 0 sold items".
|
||||
setCreditsWaiting(0);
|
||||
|
||||
SendMessageComposer(new RedeemMarketplaceOfferCreditsMessageComposer());
|
||||
|
||||
setTimeout(() => isRedeemingRef.current = false, 3000);
|
||||
|
||||
Reference in New Issue
Block a user