mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-28 06:28:41 +01:00
TradeIsCreating was only set deep inside createTrade's provider loop, after several awaits, so the swap button stayed tappable while the first call was still running and every extra tap started another trade. createTrade also had no in-progress check of its own. Now createTrade returns early if a trade is already being created, sets TradeIsCreating synchronously before the first await, and resets the state in a finally block so the button is usable again after success, failure or an unexpected exception. The ConcurrentModificationError retry now awaits the inner call instead of re-entering createTrade, so it is not blocked by the new guard. Claude-Session: https://claude.ai/code/session_016HdqYnWEiqnBvmvqCBQgjE Co-authored-by: Claude <noreply@anthropic.com>