Skip to content

Commit

Permalink
reselecting open orders after the open orders are rerendered
Browse files Browse the repository at this point in the history
  • Loading branch information
kennycud committed Jul 30, 2024
1 parent b5a9be4 commit 3b378c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/plugins/core/trade-portal/trade-portal.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,14 @@ class TradePortal extends LitElement {
this.isLoadingOpenTrades = false
}

reSelectOpenOrders() {
const qortalATAddressesString = this.shadowRoot.getElementById('qortalAtAddress').value;
const qortalATAddresses = qortalATAddressesString.split(',');
const itemsToSelect = this.tradesPresenceCleaned.filter((order) => qortalATAddresses.includes(order.qortalAtAddress));
this._openOrdersGrid.selectedItems = [...itemsToSelect];
this.fillBuyForm(itemsToSelect);
}

async reRenderMyOpenOrders() {
this.requestUpdate()
await this.updateComplete
Expand Down Expand Up @@ -2665,6 +2673,7 @@ class TradePortal extends LitElement {
filterPresenceList()
this.listedCoins.get(message.data.relatedCoin).openFilteredOrders = this.tradesPresenceCleaned
this.reRenderOpenFilteredOrders()
this.reSelectOpenOrders()
return null
default:
break
Expand Down

0 comments on commit 3b378c6

Please sign in to comment.