🚧 improve clk-info

master
Martin Zwigl 2025-02-27 23:46:22 +01:00
parent 0f3e16d482
commit f994e95e66
2 changed files with 22 additions and 15 deletions

View File

@ -12,10 +12,11 @@
}
function showClkInfo() {
this.interval = setTimeout(()=>{
this.emit("redraw");
this.interval = setInterval(()=>{
this.emit("redraw");
const self = this;
this.interval = setTimeout(() => {
self.emit("redraw");
self.interval = setInterval(() => {
self.emit("redraw");
}, 60000);
}, 60000 - (Date.now() % 60000));
}
@ -25,16 +26,22 @@
this.interval = null;
}
var coinInfoItems = {
name: "CoinInfo",
items: settings.tokenSelected.sort().map(token => {
return { name : token,
get : () => retrieveClkInfo(token),
show : showClkInfo(),
hide : hideClkInfo(),
function createClkInfoItems() {
let clkItems = [];
settings.tokens.sort().forEach(token => {
const clkItem = {
name: token,
get: () => retrieveClkInfo(token),
show: showClkInfo,
hide: hideClkInfo,
}
})
};
clkItems.push(clkItem)
});
return clkItems;
}
return coinInfoItems;
return {
name: "CoinInfo",
items: createClkInfoItems
};
})

View File

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