From 501fea7dca83a67ddd9c9cd7892c8824d68fecba Mon Sep 17 00:00:00 2001 From: Martin Zwigl Date: Sun, 23 Mar 2025 11:58:53 +0100 Subject: [PATCH] Add pause, when alerts are shown --- apps/coin_info/app.js | 17 +++++++++++++++-- apps/coin_info/metadata.json | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/coin_info/app.js b/apps/coin_info/app.js index 1e75dd55f..6a3b988fa 100644 --- a/apps/coin_info/app.js +++ b/apps/coin_info/app.js @@ -9,6 +9,7 @@ var currLoadMsg = "..."; var timePeriod = "24h"; var tknChrtData = [5,6,5,6,5,6,5,6,5,6,5,6,5,6,]; var optSpacing = {}; +var isPaused = false; // @@ -78,6 +79,11 @@ layout.update(); // var updateTimeout; function getChart(period) { + if (isPaused) { + if (updateTimeout) clearTimeout(updateTimeout); + return; + } + // timePeriod = period; currLoadMsg = `Load... ${period}`; @@ -140,8 +146,9 @@ function showLowHigh() { Low: ${low} High: ${high} `; + isPaused = true; E.showAlert(msg, title).then(function() { - // print("Ok pressed"); + isPaused = false; g.clear(); layout.forgetLazyState(); layout.render(); @@ -168,8 +175,9 @@ function showDetails() { 1h:${tokenInfo.priceChange1h} 1d:${tokenInfo.priceChange1d} 1w:${tokenInfo.priceChange1w} `; + isPaused = true; E.showAlert(msg, title).then(function() { - // print("Ok pressed"); + isPaused = false; g.clear(); layout.forgetLazyState(); layout.render(); @@ -193,6 +201,11 @@ function showDetails() { var drawTimeout; // update the screen function draw() { + if (isPaused) { + if (drawTimeout) clearTimeout(drawTimeout); + return; + } + // layout.tknName.label = (csTokens[ticker]).toUpperCase(); layout.loadMsg.label = currLoadMsg; diff --git a/apps/coin_info/metadata.json b/apps/coin_info/metadata.json index e9b1a1717..c23e21c3a 100644 --- a/apps/coin_info/metadata.json +++ b/apps/coin_info/metadata.json @@ -1,7 +1,7 @@ { "id": "coin_info", "name": "Crypto-Coins Info", "shortName":"Coins Info", - "version": "0.07.06", + "version": "0.07.07", "description": "Crypto-Coins Infos with the help of the Binance API", "icon": "app.png", "tags": "clkinfo",