disable chart animation after the first loading

pull/2887/head
Max Alekseenko 5 years ago
parent 2f0d06ad88
commit fc8ce8f79d
  1. 9
      apps/block_scout_web/assets/js/lib/market_history_chart.js

@ -142,6 +142,15 @@ class MarketHistoryChart {
}
this.availableSupply = availableSupply
config.data.datasets = [this.price, this.marketCap]
const isChartLoadedKey = 'isChartLoaded'
const isChartLoaded = window.sessionStorage.getItem(isChartLoadedKey) === 'true'
if (isChartLoaded) {
config.options.animation = false
} else {
window.sessionStorage.setItem(isChartLoadedKey, true)
}
this.chart = new Chart(el, config)
}

Loading…
Cancel
Save