Add pause, when alerts are shown

master
Martin Zwigl 2025-03-23 11:58:53 +01:00
parent 9bf8281dad
commit 501fea7dca
2 changed files with 16 additions and 3 deletions

View File

@ -9,6 +9,7 @@ var currLoadMsg = "...";
var timePeriod = "24h"; var timePeriod = "24h";
var tknChrtData = [5,6,5,6,5,6,5,6,5,6,5,6,5,6,]; var tknChrtData = [5,6,5,6,5,6,5,6,5,6,5,6,5,6,];
var optSpacing = {}; var optSpacing = {};
var isPaused = false;
// //
@ -78,6 +79,11 @@ layout.update();
// //
var updateTimeout; var updateTimeout;
function getChart(period) { function getChart(period) {
if (isPaused) {
if (updateTimeout) clearTimeout(updateTimeout);
return;
}
// //
timePeriod = period; timePeriod = period;
currLoadMsg = `Load... ${period}`; currLoadMsg = `Load... ${period}`;
@ -140,8 +146,9 @@ function showLowHigh() {
Low: ${low} Low: ${low}
High: ${high} High: ${high}
`; `;
isPaused = true;
E.showAlert(msg, title).then(function() { E.showAlert(msg, title).then(function() {
// print("Ok pressed"); isPaused = false;
g.clear(); g.clear();
layout.forgetLazyState(); layout.forgetLazyState();
layout.render(); layout.render();
@ -168,8 +175,9 @@ function showDetails() {
1h:${tokenInfo.priceChange1h} 1h:${tokenInfo.priceChange1h}
1d:${tokenInfo.priceChange1d} 1w:${tokenInfo.priceChange1w} 1d:${tokenInfo.priceChange1d} 1w:${tokenInfo.priceChange1w}
`; `;
isPaused = true;
E.showAlert(msg, title).then(function() { E.showAlert(msg, title).then(function() {
// print("Ok pressed"); isPaused = false;
g.clear(); g.clear();
layout.forgetLazyState(); layout.forgetLazyState();
layout.render(); layout.render();
@ -193,6 +201,11 @@ function showDetails() {
var drawTimeout; var drawTimeout;
// update the screen // update the screen
function draw() { function draw() {
if (isPaused) {
if (drawTimeout) clearTimeout(drawTimeout);
return;
}
// //
layout.tknName.label = (csTokens[ticker]).toUpperCase(); layout.tknName.label = (csTokens[ticker]).toUpperCase();
layout.loadMsg.label = currLoadMsg; layout.loadMsg.label = currLoadMsg;

View File

@ -1,7 +1,7 @@
{ "id": "coin_info", { "id": "coin_info",
"name": "Crypto-Coins Info", "name": "Crypto-Coins Info",
"shortName":"Coins Info", "shortName":"Coins Info",
"version": "0.07.06", "version": "0.07.07",
"description": "Crypto-Coins Infos with the help of the Binance API", "description": "Crypto-Coins Infos with the help of the Binance API",
"icon": "app.png", "icon": "app.png",
"tags": "clkinfo", "tags": "clkinfo",