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 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;

View File

@ -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",