HomePhabricator

[Cashtab] Patch bug in manage agora offers

Description

[Cashtab] Patch bug in manage agora offers

Summary:
When Orderbook was refactored so that each component owned its offer lookups, did not properly manage the distinction in how we fetch offers by pub key (agora call returns all offers, including multiple offers for the same token) and other offers (agora call returns tokenIds only, uniquely).

Correct this by using a Set to track tokenIds of managed offers. Convert to a sorted array before rendering.

Test Plan:
npm test

Create two offers with the same token ID
npm start
navigate to Agora page
toggle "manage" switch
no "duplicate key" error, no repeated orderbooks

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

Differential Revision: https://reviews.bitcoinabc.org/D17063

Event Timeline