Browse Source

Removed waitFor(250) when looping through presence transactions. This fixes the slow loading issue.

pull/80/head
CalDescent 2 years ago
parent
commit
af28e59ecd
  1. 2
      qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js

2
qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js

@ -1921,7 +1921,6 @@ class TradePortal extends LitElement {
const processOffersWithPresence = () => { const processOffersWithPresence = () => {
if (offeringTrades === null) return if (offeringTrades === null) return
const waitFor = (ms) => new Promise((r) => setTimeout(r, ms))
async function asyncForEach(array, callback) { async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) { for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array) await callback(array[index], index, array)
@ -1932,7 +1931,6 @@ class TradePortal extends LitElement {
if (tradePresenceTxns !== null) { if (tradePresenceTxns !== null) {
await asyncForEach(tradePresenceTxns, async (tradePresence) => { await asyncForEach(tradePresenceTxns, async (tradePresence) => {
await waitFor(250)
let offerIndex = offeringTrades.findIndex((offeringTrade) => offeringTrade.qortalCreatorTradeAddress === tradePresence.tradeAddress) let offerIndex = offeringTrades.findIndex((offeringTrade) => offeringTrade.qortalCreatorTradeAddress === tradePresence.tradeAddress)
offerIndex !== -1 ? (offeringTrades[offerIndex].tradePresenceExpiry = tradePresence.timestamp) : null offerIndex !== -1 ? (offeringTrades[offerIndex].tradePresenceExpiry = tradePresence.timestamp) : null
}) })

Loading…
Cancel
Save