launch price check on start

This commit is contained in:
Ben Arc 2021-04-20 13:47:48 +01:00
parent ddeb3fa9b2
commit 9b1430a119

View file

@ -124,13 +124,8 @@
})
}
},
animation1: function () {
getPrice: function () {
self = this
setTimeout(function () {
setInterval(function () {
self.connection.send('')
self.counter++
if (self.counter % 20 === 0) {
if ('{{ copilot.show_price }}' != 'None') {
LNbits.api
.request('GET', 'https://api.opennode.com/v1/rates', 'filla')
@ -147,6 +142,16 @@
LNbits.utils.notifyApiError(error)
})
}
},
animation1: function () {
self = this
self.getPrice
setTimeout(function () {
setInterval(function () {
self.connection.send('')
self.counter++
if (self.counter % 20 === 0) {
self.getPrice
}
}, 1000)
}, 2000)