[bisq-network/bisq] Prevent UI freeze in BSQ dashboard view. (PR #6131)

xyzmaker123 notifications at github.com
Tue Apr 5 12:16:46 CEST 2022


@xyzmaker123 commented on this pull request.



> @@ -122,10 +125,15 @@ public void initialize() {
         createTradeChart();
 
         priceChangeListener = (observable, oldValue, newValue) -> {
-            updatePrice();
-            updateAveragePriceFields(avgPrice90TextField, avgPrice30TextField, false);
-            updateAveragePriceFields(avgUSDPrice90TextField, avgUSDPrice30TextField, true);
-            updateMarketCap();
+            if (System.currentTimeMillis() - lastActivityTime < FASTEST_UPDATE_FREQUENCY_MILLIS) {
+                log.trace("Last activity: {}ms, we ignore this update to prevent freezing the UI.", System.currentTimeMillis() - lastActivityTime);

What about removing [`updateCounter.set(updateCounter.get() + 1);`](https://github.com/bisq-network/bisq/blob/ad2a329e089ceaaf91e2bfee3e70a41941a3245a/core/src/main/java/bisq/core/provider/price/PriceFeedService.java#L266) from `setBisqMarketPrice` method and calling it once after [these updates](https://github.com/bisq-network/bisq/blob/ad2a329e089ceaaf91e2bfee3e70a41941a3245a/core/src/main/java/bisq/core/provider/price/PriceFeedService.java#L319-L325) instead of this throttling here?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/6131#pullrequestreview-931611593
You are receiving this because you are subscribed to this thread.

Message ID: <bisq-network/bisq/pull/6131/review/931611593 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20220405/c65778fa/attachment.htm>


More information about the bisq-github mailing list