2020-09-02 12:44:54 -03:00
|
|
|
/* globals decode, Vue, VueQrcodeReader, VueQrcode, Quasar, LNbits, _, EventHub, Chart */
|
2020-08-31 22:12:46 -03:00
|
|
|
|
2020-05-03 13:55:17 -03:00
|
|
|
Vue.component(VueQrcode.name, VueQrcode)
|
|
|
|
Vue.use(VueQrcodeReader)
|
2020-03-05 20:29:27 +01:00
|
|
|
|
2020-03-07 22:27:00 +01:00
|
|
|
function generateChart(canvas, payments) {
|
2020-05-03 13:55:17 -03:00
|
|
|
var txs = []
|
|
|
|
var n = 0
|
2020-03-05 20:29:27 +01:00
|
|
|
var data = {
|
|
|
|
labels: [],
|
2020-03-07 22:27:00 +01:00
|
|
|
income: [],
|
|
|
|
outcome: [],
|
2020-03-05 20:29:27 +01:00
|
|
|
cumulative: []
|
2020-05-03 13:55:17 -03:00
|
|
|
}
|
2020-03-05 20:29:27 +01:00
|
|
|
|
2020-05-03 13:55:17 -03:00
|
|
|
_.each(
|
2020-09-29 15:43:11 -03:00
|
|
|
payments
|
|
|
|
.filter(p => !p.pending)
|
|
|
|
.sort(function (a, b) {
|
|
|
|
return a.time - b.time
|
|
|
|
}),
|
2020-09-02 19:19:18 -03:00
|
|
|
function (tx) {
|
2020-05-03 13:55:17 -03:00
|
|
|
txs.push({
|
|
|
|
hour: Quasar.utils.date.formatDate(tx.date, 'YYYY-MM-DDTHH:00'),
|
|
|
|
sat: tx.sat
|
|
|
|
})
|
|
|
|
}
|
|
|
|
)
|
2020-03-05 20:29:27 +01:00
|
|
|
|
2020-09-02 19:19:18 -03:00
|
|
|
_.each(_.groupBy(txs, 'hour'), function (value, day) {
|
2020-05-03 13:55:17 -03:00
|
|
|
var income = _.reduce(
|
|
|
|
value,
|
2020-09-02 19:19:18 -03:00
|
|
|
function (memo, tx) {
|
2020-05-03 13:55:17 -03:00
|
|
|
return tx.sat >= 0 ? memo + tx.sat : memo
|
|
|
|
},
|
|
|
|
0
|
|
|
|
)
|
|
|
|
var outcome = _.reduce(
|
|
|
|
value,
|
2020-09-02 19:19:18 -03:00
|
|
|
function (memo, tx) {
|
2020-05-03 13:55:17 -03:00
|
|
|
return tx.sat < 0 ? memo + Math.abs(tx.sat) : memo
|
|
|
|
},
|
|
|
|
0
|
|
|
|
)
|
|
|
|
n = n + income - outcome
|
|
|
|
data.labels.push(day)
|
|
|
|
data.income.push(income)
|
|
|
|
data.outcome.push(outcome)
|
|
|
|
data.cumulative.push(n)
|
|
|
|
})
|
2020-03-05 20:29:27 +01:00
|
|
|
|
|
|
|
new Chart(canvas.getContext('2d'), {
|
|
|
|
type: 'bar',
|
|
|
|
data: {
|
|
|
|
labels: data.labels,
|
|
|
|
datasets: [
|
|
|
|
{
|
|
|
|
data: data.cumulative,
|
|
|
|
type: 'line',
|
|
|
|
label: 'balance',
|
2020-05-03 13:55:17 -03:00
|
|
|
backgroundColor: '#673ab7', // deep-purple
|
2020-03-07 22:27:00 +01:00
|
|
|
borderColor: '#673ab7',
|
2020-03-05 20:29:27 +01:00
|
|
|
borderWidth: 4,
|
|
|
|
pointRadius: 3,
|
|
|
|
fill: false
|
|
|
|
},
|
|
|
|
{
|
2020-03-07 22:27:00 +01:00
|
|
|
data: data.income,
|
2020-03-05 20:29:27 +01:00
|
|
|
type: 'bar',
|
2020-03-07 22:27:00 +01:00
|
|
|
label: 'in',
|
|
|
|
barPercentage: 0.75,
|
2020-09-02 19:19:18 -03:00
|
|
|
backgroundColor: window.Color('rgb(76,175,80)').alpha(0.5).rgbString() // green
|
2020-03-07 22:27:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
data: data.outcome,
|
|
|
|
type: 'bar',
|
|
|
|
label: 'out',
|
|
|
|
barPercentage: 0.75,
|
2020-09-02 19:19:18 -03:00
|
|
|
backgroundColor: window.Color('rgb(233,30,99)').alpha(0.5).rgbString() // pink
|
2020-03-05 20:29:27 +01:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
title: {
|
|
|
|
text: 'Chart.js Combo Time Scale'
|
|
|
|
},
|
|
|
|
tooltips: {
|
|
|
|
mode: 'index',
|
2020-05-03 13:55:17 -03:00
|
|
|
intersect: false
|
2020-03-05 20:29:27 +01:00
|
|
|
},
|
|
|
|
scales: {
|
2020-05-03 13:55:17 -03:00
|
|
|
xAxes: [
|
|
|
|
{
|
|
|
|
type: 'time',
|
|
|
|
display: true,
|
|
|
|
offset: true,
|
|
|
|
time: {
|
|
|
|
minUnit: 'hour',
|
|
|
|
stepSize: 3
|
|
|
|
}
|
2020-03-05 20:29:27 +01:00
|
|
|
}
|
2020-05-03 13:55:17 -03:00
|
|
|
]
|
2020-03-05 20:29:27 +01:00
|
|
|
},
|
2020-03-07 22:27:00 +01:00
|
|
|
// performance tweaks
|
|
|
|
animation: {
|
|
|
|
duration: 0
|
|
|
|
},
|
|
|
|
elements: {
|
|
|
|
line: {
|
|
|
|
tension: 0
|
|
|
|
}
|
|
|
|
}
|
2020-03-05 20:29:27 +01:00
|
|
|
}
|
2020-05-03 13:55:17 -03:00
|
|
|
})
|
2020-03-05 20:29:27 +01:00
|
|
|
}
|
|
|
|
|
2020-03-04 23:11:15 +01:00
|
|
|
new Vue({
|
|
|
|
el: '#vue',
|
|
|
|
mixins: [windowMixin],
|
2020-09-02 19:19:18 -03:00
|
|
|
data: function () {
|
2020-03-04 23:11:15 +01:00
|
|
|
return {
|
2020-09-02 12:44:54 -03:00
|
|
|
user: LNbits.map.user(window.user),
|
2020-03-04 23:11:15 +01:00
|
|
|
receive: {
|
|
|
|
show: false,
|
|
|
|
status: 'pending',
|
|
|
|
paymentReq: null,
|
|
|
|
data: {
|
|
|
|
amount: null,
|
|
|
|
memo: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
send: {
|
|
|
|
show: false,
|
|
|
|
invoice: null,
|
|
|
|
data: {
|
|
|
|
bolt11: ''
|
|
|
|
}
|
|
|
|
},
|
2020-03-10 23:12:22 +01:00
|
|
|
sendCamera: {
|
|
|
|
show: false,
|
|
|
|
camera: 'auto'
|
|
|
|
},
|
2020-03-07 22:27:00 +01:00
|
|
|
payments: [],
|
|
|
|
paymentsTable: {
|
2020-03-04 23:11:15 +01:00
|
|
|
columns: [
|
2020-09-02 12:44:54 -03:00
|
|
|
{
|
|
|
|
name: 'memo',
|
|
|
|
align: 'left',
|
|
|
|
label: 'Memo',
|
|
|
|
field: 'memo'
|
|
|
|
},
|
2020-05-03 13:55:17 -03:00
|
|
|
{
|
|
|
|
name: 'date',
|
|
|
|
align: 'left',
|
|
|
|
label: 'Date',
|
|
|
|
field: 'date',
|
|
|
|
sortable: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'sat',
|
|
|
|
align: 'right',
|
|
|
|
label: 'Amount (sat)',
|
|
|
|
field: 'sat',
|
|
|
|
sortable: true
|
|
|
|
}
|
2020-03-04 23:11:15 +01:00
|
|
|
],
|
|
|
|
pagination: {
|
|
|
|
rowsPerPage: 10
|
2020-04-17 21:13:32 +02:00
|
|
|
},
|
|
|
|
filter: null
|
2020-03-05 20:29:27 +01:00
|
|
|
},
|
2020-03-07 22:27:00 +01:00
|
|
|
paymentsChart: {
|
2020-03-05 20:29:27 +01:00
|
|
|
show: false
|
2020-04-21 15:29:23 +02:00
|
|
|
},
|
|
|
|
disclaimerDialog: {
|
|
|
|
show: false,
|
|
|
|
location: window.location
|
2020-09-29 20:04:02 -03:00
|
|
|
},
|
|
|
|
balance: 0
|
2020-05-03 13:55:17 -03:00
|
|
|
}
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
|
|
|
computed: {
|
2020-09-29 20:04:02 -03:00
|
|
|
formattedBalance: function () {
|
|
|
|
return LNbits.utils.formatSat(this.balance || this.g.wallet.sat)
|
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
filteredPayments: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
var q = this.paymentsTable.filter
|
2020-09-02 12:44:54 -03:00
|
|
|
if (!q || q === '') return this.payments
|
2020-04-17 21:13:32 +02:00
|
|
|
|
2020-05-03 13:55:17 -03:00
|
|
|
return LNbits.utils.search(this.payments, q)
|
2020-04-17 21:13:32 +02:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
canPay: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
if (!this.send.invoice) return false
|
|
|
|
return this.send.invoice.sat <= this.balance
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
pendingPaymentsExist: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
return this.payments
|
2020-03-07 22:27:00 +01:00
|
|
|
? _.where(this.payments, {pending: 1}).length > 0
|
2020-05-03 13:55:17 -03:00
|
|
|
: false
|
2020-03-04 23:11:15 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2020-09-02 19:19:18 -03:00
|
|
|
closeCamera: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
this.sendCamera.show = false
|
2020-03-10 23:12:22 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
showCamera: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
this.sendCamera.show = true
|
2020-03-10 23:12:22 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
showChart: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
this.paymentsChart.show = true
|
2020-09-02 19:19:18 -03:00
|
|
|
this.$nextTick(function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
generateChart(this.$refs.canvas, this.payments)
|
|
|
|
})
|
2020-03-07 22:27:00 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
showReceiveDialog: function () {
|
2020-03-04 23:11:15 +01:00
|
|
|
this.receive = {
|
|
|
|
show: true,
|
|
|
|
status: 'pending',
|
|
|
|
paymentReq: null,
|
|
|
|
data: {
|
|
|
|
amount: null,
|
|
|
|
memo: ''
|
2020-03-07 22:27:00 +01:00
|
|
|
},
|
|
|
|
paymentChecker: null
|
2020-05-03 13:55:17 -03:00
|
|
|
}
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
showSendDialog: function () {
|
2020-03-04 23:11:15 +01:00
|
|
|
this.send = {
|
|
|
|
show: true,
|
|
|
|
invoice: null,
|
|
|
|
data: {
|
|
|
|
bolt11: ''
|
2020-03-10 23:12:22 +01:00
|
|
|
},
|
|
|
|
paymentChecker: null
|
2020-05-03 13:55:17 -03:00
|
|
|
}
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
closeReceiveDialog: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
var checker = this.receive.paymentChecker
|
2020-09-02 19:19:18 -03:00
|
|
|
setTimeout(function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
clearInterval(checker)
|
|
|
|
}, 10000)
|
2020-03-05 20:29:27 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
closeSendDialog: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
this.sendCamera.show = false
|
|
|
|
var checker = this.send.paymentChecker
|
2020-09-02 19:19:18 -03:00
|
|
|
setTimeout(function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
clearInterval(checker)
|
|
|
|
}, 1000)
|
2020-03-10 23:12:22 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
createInvoice: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
var self = this
|
|
|
|
this.receive.status = 'loading'
|
|
|
|
LNbits.api
|
|
|
|
.createInvoice(
|
|
|
|
this.g.wallet,
|
|
|
|
this.receive.data.amount,
|
|
|
|
this.receive.data.memo
|
|
|
|
)
|
2020-09-02 19:19:18 -03:00
|
|
|
.then(function (response) {
|
2020-05-03 13:55:17 -03:00
|
|
|
self.receive.status = 'success'
|
|
|
|
self.receive.paymentReq = response.data.payment_request
|
2020-03-04 23:11:15 +01:00
|
|
|
|
2020-09-02 19:19:18 -03:00
|
|
|
self.receive.paymentChecker = setInterval(function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
LNbits.api
|
2020-08-31 22:12:46 -03:00
|
|
|
.getPayment(self.g.wallet, response.data.payment_hash)
|
2020-09-02 19:19:18 -03:00
|
|
|
.then(function (response) {
|
2020-05-03 13:55:17 -03:00
|
|
|
if (response.data.paid) {
|
|
|
|
self.fetchPayments()
|
|
|
|
self.receive.show = false
|
|
|
|
clearInterval(self.receive.paymentChecker)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}, 2000)
|
|
|
|
})
|
2020-09-02 19:19:18 -03:00
|
|
|
.catch(function (error) {
|
2020-05-03 13:55:17 -03:00
|
|
|
LNbits.utils.notifyApiError(error)
|
|
|
|
self.receive.status = 'pending'
|
|
|
|
})
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
decodeQR: function (res) {
|
2020-05-03 13:55:17 -03:00
|
|
|
this.send.data.bolt11 = res
|
|
|
|
this.decodeInvoice()
|
|
|
|
this.sendCamera.show = false
|
2020-03-10 23:12:22 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
decodeInvoice: function () {
|
2020-04-27 23:13:42 +02:00
|
|
|
if (this.send.data.bolt11.startsWith('lightning:')) {
|
2020-05-03 13:55:17 -03:00
|
|
|
this.send.data.bolt11 = this.send.data.bolt11.slice(10)
|
2020-04-27 23:13:42 +02:00
|
|
|
}
|
|
|
|
|
2020-05-03 13:55:17 -03:00
|
|
|
let invoice
|
2020-03-04 23:11:15 +01:00
|
|
|
try {
|
2020-05-03 13:55:17 -03:00
|
|
|
invoice = decode(this.send.data.bolt11)
|
2020-03-07 22:27:00 +01:00
|
|
|
} catch (error) {
|
|
|
|
this.$q.notify({
|
|
|
|
timeout: 3000,
|
|
|
|
type: 'warning',
|
|
|
|
message: error + '.',
|
|
|
|
caption: '400 BAD REQUEST',
|
|
|
|
icon: null
|
2020-05-03 13:55:17 -03:00
|
|
|
})
|
|
|
|
return
|
2020-03-04 23:11:15 +01:00
|
|
|
}
|
|
|
|
|
2020-04-27 23:13:42 +02:00
|
|
|
let cleanInvoice = {
|
2020-03-04 23:11:15 +01:00
|
|
|
msat: invoice.human_readable_part.amount,
|
|
|
|
sat: invoice.human_readable_part.amount / 1000,
|
|
|
|
fsat: LNbits.utils.formatSat(invoice.human_readable_part.amount / 1000)
|
2020-05-03 13:55:17 -03:00
|
|
|
}
|
2020-03-04 23:11:15 +01:00
|
|
|
|
2020-09-02 19:19:18 -03:00
|
|
|
_.each(invoice.data.tags, function (tag) {
|
2020-03-04 23:11:15 +01:00
|
|
|
if (_.isObject(tag) && _.has(tag, 'description')) {
|
2020-09-02 12:44:54 -03:00
|
|
|
if (tag.description === 'payment_hash') {
|
2020-05-03 13:55:17 -03:00
|
|
|
cleanInvoice.hash = tag.value
|
2020-09-02 12:44:54 -03:00
|
|
|
} else if (tag.description === 'description') {
|
2020-05-03 13:55:17 -03:00
|
|
|
cleanInvoice.description = tag.value
|
2020-09-02 12:44:54 -03:00
|
|
|
} else if (tag.description === 'expiry') {
|
2020-05-03 13:55:17 -03:00
|
|
|
var expireDate = new Date(
|
|
|
|
(invoice.data.time_stamp + tag.value) * 1000
|
|
|
|
)
|
|
|
|
cleanInvoice.expireDate = Quasar.utils.date.formatDate(
|
|
|
|
expireDate,
|
|
|
|
'YYYY-MM-DDTHH:mm:ss.SSSZ'
|
|
|
|
)
|
|
|
|
cleanInvoice.expired = false // TODO
|
2020-03-04 23:11:15 +01:00
|
|
|
}
|
|
|
|
}
|
2020-05-03 13:55:17 -03:00
|
|
|
})
|
2020-03-04 23:11:15 +01:00
|
|
|
|
2020-05-03 13:55:17 -03:00
|
|
|
this.send.invoice = Object.freeze(cleanInvoice)
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
payInvoice: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
var self = this
|
2020-03-07 22:27:00 +01:00
|
|
|
|
2020-08-31 22:12:46 -03:00
|
|
|
let dismissPaymentMsg = this.$q.notify({
|
2020-03-07 22:27:00 +01:00
|
|
|
timeout: 0,
|
|
|
|
message: 'Processing payment...',
|
|
|
|
icon: null
|
2020-05-03 13:55:17 -03:00
|
|
|
})
|
2020-03-07 22:27:00 +01:00
|
|
|
|
2020-05-03 13:55:17 -03:00
|
|
|
LNbits.api
|
|
|
|
.payInvoice(this.g.wallet, this.send.data.bolt11)
|
2020-09-02 19:19:18 -03:00
|
|
|
.then(function (response) {
|
|
|
|
self.send.paymentChecker = setInterval(function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
LNbits.api
|
2020-08-31 22:12:46 -03:00
|
|
|
.getPayment(self.g.wallet, response.data.payment_hash)
|
2020-09-02 19:19:18 -03:00
|
|
|
.then(function (res) {
|
2020-05-03 13:55:17 -03:00
|
|
|
if (res.data.paid) {
|
|
|
|
self.send.show = false
|
|
|
|
clearInterval(self.send.paymentChecker)
|
|
|
|
dismissPaymentMsg()
|
|
|
|
self.fetchPayments()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}, 2000)
|
|
|
|
})
|
2020-09-02 19:19:18 -03:00
|
|
|
.catch(function (error) {
|
2020-05-03 13:55:17 -03:00
|
|
|
dismissPaymentMsg()
|
|
|
|
LNbits.utils.notifyApiError(error)
|
|
|
|
})
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
deleteWallet: function (walletId, user) {
|
2020-05-03 13:55:17 -03:00
|
|
|
LNbits.utils
|
|
|
|
.confirmDialog('Are you sure you want to delete this wallet?')
|
2020-09-02 19:19:18 -03:00
|
|
|
.onOk(function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
LNbits.href.deleteWallet(walletId, user)
|
|
|
|
})
|
2020-03-04 23:11:15 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
fetchPayments: function (checkPending) {
|
2020-05-03 13:55:17 -03:00
|
|
|
var self = this
|
2020-03-04 23:11:15 +01:00
|
|
|
|
2020-05-03 13:55:17 -03:00
|
|
|
return LNbits.api
|
|
|
|
.getPayments(this.g.wallet, checkPending)
|
2020-09-02 19:19:18 -03:00
|
|
|
.then(function (response) {
|
2020-05-03 13:55:17 -03:00
|
|
|
self.payments = response.data
|
2020-09-02 19:19:18 -03:00
|
|
|
.map(function (obj) {
|
2020-05-03 13:55:17 -03:00
|
|
|
return LNbits.map.payment(obj)
|
|
|
|
})
|
2020-09-02 19:19:18 -03:00
|
|
|
.sort(function (a, b) {
|
2020-05-03 13:55:17 -03:00
|
|
|
return b.time - a.time
|
|
|
|
})
|
|
|
|
})
|
2020-03-07 22:27:00 +01:00
|
|
|
},
|
2020-09-29 20:04:02 -03:00
|
|
|
fetchBalance: function () {
|
|
|
|
var self = this
|
|
|
|
LNbits.api.getWallet(self.g.wallet).then(function (response) {
|
|
|
|
self.balance = Math.round(response.data.balance / 1000)
|
|
|
|
EventHub.$emit('update-wallet-balance', [
|
|
|
|
self.g.wallet.id,
|
|
|
|
self.balance
|
|
|
|
])
|
|
|
|
})
|
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
checkPendingPayments: function () {
|
2020-03-07 22:27:00 +01:00
|
|
|
var dismissMsg = this.$q.notify({
|
|
|
|
timeout: 0,
|
|
|
|
message: 'Checking pending transactions...',
|
|
|
|
icon: null
|
2020-05-03 13:55:17 -03:00
|
|
|
})
|
2020-03-07 22:27:00 +01:00
|
|
|
|
2020-09-02 19:19:18 -03:00
|
|
|
this.fetchPayments(true).then(function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
dismissMsg()
|
|
|
|
})
|
2020-04-01 22:18:46 +02:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
exportCSV: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
LNbits.utils.exportCSV(this.paymentsTable.columns, this.payments)
|
2020-04-01 22:18:46 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
2020-09-02 19:19:18 -03:00
|
|
|
payments: function () {
|
2020-09-29 20:04:02 -03:00
|
|
|
this.fetchBalance()
|
2020-03-04 23:11:15 +01:00
|
|
|
}
|
2020-03-07 22:27:00 +01:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
created: function () {
|
2020-09-29 20:04:02 -03:00
|
|
|
this.fetchBalance()
|
2020-05-03 13:55:17 -03:00
|
|
|
this.fetchPayments()
|
|
|
|
setTimeout(this.checkPendingPayments(), 1200)
|
2020-04-23 21:25:46 +02:00
|
|
|
},
|
2020-09-02 19:19:18 -03:00
|
|
|
mounted: function () {
|
2020-05-03 13:55:17 -03:00
|
|
|
if (
|
|
|
|
this.$refs.disclaimer &&
|
|
|
|
!this.$q.localStorage.getItem('lnbits.disclaimerShown')
|
|
|
|
) {
|
|
|
|
this.disclaimerDialog.show = true
|
|
|
|
this.$q.localStorage.set('lnbits.disclaimerShown', true)
|
2020-04-21 23:47:16 +02:00
|
|
|
}
|
2020-03-04 23:11:15 +01:00
|
|
|
}
|
2020-05-03 13:55:17 -03:00
|
|
|
})
|