diff --git a/apps/block_scout_web/assets/js/lib/market_history_chart.js b/apps/block_scout_web/assets/js/lib/market_history_chart.js index 61c2b4695a..ae70a1b5d1 100644 --- a/apps/block_scout_web/assets/js/lib/market_history_chart.js +++ b/apps/block_scout_web/assets/js/lib/market_history_chart.js @@ -129,6 +129,9 @@ class MarketHistoryChart { export function createMarketHistoryChart (el) { const dataPath = el.dataset.market_history_chart_path const $chartLoading = $('[data-chart-loading-message]') + + $chartLoading.removeAttr('hidden') + const $chartError = $('[data-chart-error-message]') const chart = new MarketHistoryChart(el, 0, []) $.getJSON(dataPath, {type: 'JSON'}) @@ -148,7 +151,6 @@ export function createMarketHistoryChart (el) { } $('[data-chart-error-message]').on('click', _event => { - $('[data-chart-loading-message]').removeAttr('hidden') $('[data-chart-loading-message]').show() $('[data-chart-error-message]').hide() createMarketHistoryChart($('[data-chart="marketHistoryChart"]')[0]) diff --git a/apps/block_scout_web/assets/js/pages/chain.js b/apps/block_scout_web/assets/js/pages/chain.js index 435a580188..f0586ef796 100644 --- a/apps/block_scout_web/assets/js/pages/chain.js +++ b/apps/block_scout_web/assets/js/pages/chain.js @@ -210,7 +210,7 @@ const elements = { }, '[data-selector="chain-block-list"] [data-selector="loading-message"]': { render ($el, state, oldState) { - if (state.blocksLoading) { + if (state && state.blocksLoading) { setTimeout(function () { $el.removeAttr('hidden') $el.show() @@ -227,7 +227,7 @@ const elements = { }, '[data-selector="transactions-list"] [data-selector="loading-message"]': { render ($el, state, oldState) { - if (state.transactionsLoading) { + if (state && state.transactionsLoading) { setTimeout(function () { $el.removeAttr('hidden') $el.show()