project-serum / swap-ui

React Component for Swapping on the Serum DEX
Apache License 2.0
113 stars 117 forks source link

Newly created open orders accounts aren't picked up by the manage dex component #15

Open armaniferrante opened 3 years ago

armaniferrante commented 3 years ago

When the swap component creates a new open orders account, because it detects one doesn't exist, it doesn't save that open orders account after the transaction completes. This will cause the component to recreate a new open orders account, even though one exists, if one initiates a swap for the second time without refreshing.

One easy solution is to just save the new open orders accounts into the context open orders cache immediately after the transaction to create them completes.