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:
simoleo89
2026-06-13 16:53:36 +02:00
parent 93baedf206
commit 26d7ccd62b
@@ -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);