From 8ff04d757ca7b13f992fd291bd7ad6bc872290e1 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Fri, 25 Feb 2022 10:34:34 +0100 Subject: [PATCH] Fix blank my orders grid after listed --- .../core/trade-portal/trade-portal.src.js | 81 ++++++++++--------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js b/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js index 7a67075c..591ad812 100644 --- a/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js +++ b/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js @@ -44,10 +44,10 @@ class TradePortal extends LitElement { --mdc-theme-primary: rgb(3, 169, 244); --mdc-theme-secondary: var(--mdc-theme-primary); --paper-input-container-focus-color: var(--mdc-theme-primary); - --lumo-primary-text-color: rgb(0, 167, 245); - --lumo-primary-color-50pct: rgba(0, 167, 245, 0.5); - --lumo-primary-color-10pct: rgba(0, 167, 245, 0.1); - --lumo-primary-color: hsl(199, 100%, 48%); + --lumo-primary-text-color: rgb(0, 167, 245); + --lumo-primary-color-50pct: rgba(0, 167, 245, 0.5); + --lumo-primary-color-10pct: rgba(0, 167, 245, 0.1); + --lumo-primary-color: hsl(199, 100%, 48%); } #tabs-1 { @@ -452,9 +452,9 @@ class TradePortal extends LitElement { resizable header="Price (${this.listedCoins.get(this.selectedCoin).coinCode})" .renderer=${(root, column, data) => { - const price = this.round(parseFloat(data.item.foreignAmount) / parseFloat(data.item.qortAmount)) - render(html`${price}`, root) - }} + const price = this.round(parseFloat(data.item.foreignAmount) / parseFloat(data.item.qortAmount)) + render(html`${price}`, root) + }} > { - render(html` ${data.item.foreignAmount} `, root) - }} + render(html` ${data.item.foreignAmount} `, root) + }} > @@ -488,8 +488,8 @@ class TradePortal extends LitElement { id="qortAmountColumn" path="qortAmount" .renderer=${(root, column, data) => { - render(html` ${this.round(data.item.qortAmount)} `, root) - }} + render(html` ${this.round(data.item.qortAmount)} `, root) + }} > { - render(html` ${this.round(data.item.price)} `, root) - }} + render(html` ${this.round(data.item.price)} `, root) + }} > { - render(html` ${data.item.foreignAmount} `, root) - }} + render(html` ${data.item.foreignAmount} `, root) + }} > { - render(html` ${data.item.qortalCreator} `, root) - }} + render(html` ${data.item.qortalCreator} `, root) + }} > @@ -673,9 +673,9 @@ class TradePortal extends LitElement { resizable header="Date" .renderer=${(root, column, data) => { - const dateString = new Date(data.item.timestamp).toLocaleString() - render(html`${dateString}`, root) - }} + const dateString = new Date(data.item.timestamp).toLocaleString() + render(html`${dateString}`, root) + }} > { - render(html` ${data.item._tradeState} `, root) - }} + render(html` ${data.item._tradeState} `, root) + }} > { - const price = this.round(parseFloat(data.item.foreignAmount) / parseFloat(data.item.qortAmount)) - render(html`${price}`, root) - }} + const price = this.round(parseFloat(data.item.foreignAmount) / parseFloat(data.item.qortAmount)) + render(html`${price}`, root) + }} > { - render(html`${this.renderCancelButton(data.item)}`, root) - }} + render(html`${this.renderCancelButton(data.item)}`, root) + }} > @@ -737,9 +737,9 @@ class TradePortal extends LitElement { resizable header="Date" .renderer=${(root, column, data) => { - const dateString = new Date(data.item.timestamp).toLocaleString() - render(html`${dateString}`, root) - }} + const dateString = new Date(data.item.timestamp).toLocaleString() + render(html`${dateString}`, root) + }} > { - if (data.item.mode === 'SOLD') return render(html` ${data.item.mode} `, root) - if (data.item.mode === 'BOUGHT') return render(html` ${data.item.mode} `, root) - return render(html` ${data.item.mode} `, root) - }} + if (data.item.mode === 'SOLD') return render(html` ${data.item.mode} `, root) + if (data.item.mode === 'BOUGHT') return render(html` ${data.item.mode} `, root) + return render(html` ${data.item.mode} `, root) + }} > { - const price = this.round(parseFloat(data.item.foreignAmount) / parseFloat(data.item.qortAmount)) - render(html`${price}`, root) - }} + const price = this.round(parseFloat(data.item.foreignAmount) / parseFloat(data.item.qortAmount)) + render(html`${price}`, root) + }} > { - render(html` ${data.item.foreignAmount} `, root) - }} + render(html` ${data.item.foreignAmount} `, root) + }} > @@ -1331,6 +1331,7 @@ class TradePortal extends LitElement { const updateStateItem = () => { this._myOrdersGrid.items.forEach((item, index) => { if (item.atAddress === state.atAddress) { + this.reRenderMyOpenOrders() this._myOrdersGrid.items.splice(index, 1) this._myOrdersGrid.items.unshift(stateItem) this._myOrdersGrid.clearCache() @@ -1344,6 +1345,7 @@ class TradePortal extends LitElement { handleCompletedState(state) { this._myOrdersGrid.items.forEach((item, index) => { if (item.atAddress === state.atAddress) { + this.reRenderMyOpenOrders() this._myOrdersGrid.items.splice(index, 1) this._myOrdersGrid.clearCache() } @@ -1927,6 +1929,7 @@ class TradePortal extends LitElement { this._openOrdersGrid.clearCache() this._myHistoricTradesGrid.clearCache() this._historicTradesGrid.clearCache() + this._myOrdersGrid.clearCache() } createConnection() {