mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Fix: Better memory/tooltip/clean-up managers, various fixes.
This commit is contained in:
@@ -578,7 +578,7 @@ const chartModule = {
|
||||
this.chartRefs.set(element, chart);
|
||||
},
|
||||
|
||||
destroyChart: function() {
|
||||
destroyChart: function() {
|
||||
if (chartModule.chart) {
|
||||
try {
|
||||
const chartInstance = chartModule.chart;
|
||||
@@ -592,12 +592,17 @@ const chartModule = {
|
||||
|
||||
if (canvas) {
|
||||
chartModule.chartRefs.delete(canvas);
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (ctx) {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error destroying chart:', e);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
initChart: function() {
|
||||
this.destroyChart();
|
||||
|
||||
Reference in New Issue
Block a user