fix: wallet chart render racecondition (#3595)
This commit is contained in:
parent
1057b4693f
commit
b5f3a46feb
2 changed files with 45 additions and 46 deletions
2
lnbits/static/bundle-components.min.js
vendored
2
lnbits/static/bundle-components.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -102,9 +102,9 @@ window.app.component('lnbits-wallet-charts', {
|
||||||
if (this.walletBalanceInOut) {
|
if (this.walletBalanceInOut) {
|
||||||
this.walletBalanceInOut.destroy()
|
this.walletBalanceInOut.destroy()
|
||||||
}
|
}
|
||||||
this.walletBalanceInOut = new Chart(
|
const ref = this.$refs.walletBalanceInOut
|
||||||
this.$refs.walletBalanceInOut.getContext('2d'),
|
if (!ref) return
|
||||||
{
|
this.walletBalanceInOut = new Chart(ref.getContext('2d'), {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
options: this.barOptions,
|
options: this.barOptions,
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -124,16 +124,15 @@ window.app.component('lnbits-wallet-charts', {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
)
|
|
||||||
},
|
},
|
||||||
drawPaymentInOut(data, labels) {
|
drawPaymentInOut(data, labels) {
|
||||||
if (this.walletPaymentInOut) {
|
if (this.walletPaymentInOut) {
|
||||||
this.walletPaymentInOut.destroy()
|
this.walletPaymentInOut.destroy()
|
||||||
}
|
}
|
||||||
this.walletPaymentInOut = new Chart(
|
const ref = this.$refs.walletPaymentInOut
|
||||||
this.$refs.walletPaymentInOut.getContext('2d'),
|
if (!ref) return
|
||||||
{
|
this.walletPaymentInOut = new Chart(ref.getContext('2d'), {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
options: this.barOptions,
|
options: this.barOptions,
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -151,14 +150,14 @@ window.app.component('lnbits-wallet-charts', {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
)
|
|
||||||
},
|
},
|
||||||
drawBalanceChart(data, labels) {
|
drawBalanceChart(data, labels) {
|
||||||
const ref = this.$refs.walletBalanceChart
|
|
||||||
if (this.walletBalanceChart) {
|
if (this.walletBalanceChart) {
|
||||||
this.walletBalanceChart.destroy()
|
this.walletBalanceChart.destroy()
|
||||||
}
|
}
|
||||||
|
const ref = this.$refs.walletBalanceChart
|
||||||
|
if (!ref) return
|
||||||
this.walletBalanceChart = new Chart(ref.getContext('2d'), {
|
this.walletBalanceChart = new Chart(ref.getContext('2d'), {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
options: {
|
options: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue