Skip to content

Commit d88a9d0

Browse files
committed
(Rework): Removed hack for delayed display of Runtime phase and made correct sync ordering
1 parent 09da68d commit d88a9d0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

frontend/js/helpers/phase-stats.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ const getAndShowPhase = () => {
5959
const sub_phase_regex = /^[\.\s0-9a-zA-Z_\(\)-]+$/; // Matches strings containing only letters and digits
6060
if (phase_to_display[1] != null && sub_phase_regex.test(phase_to_display[1])) {
6161
try {
62-
setTimeout(function(){
63-
document.querySelector(`a.runtime-step[data-tab="${phase_to_display[1]}"`).dispatchEvent(new Event('click'));
64-
}, 1000); // hacky ... this needs better solution ... but unclear WHY it is not sync ...
62+
document.querySelector(`a.runtime-step[data-tab="${phase_to_display[1]}"`).dispatchEvent(new Event('click'));
6563
} catch(err) {
6664
console.log('Could not match phase to show', err);
6765
}

frontend/js/stats.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,15 @@ const fetchAndFillPhaseStatsData = async (url_params) => {
330330

331331

332332
buildPhaseTabs(phase_stats.data)
333-
renderCompareChartsForPhase(phase_stats.data, getAndShowPhase());
334-
displayTotalChart(...buildTotalChartData(phase_stats.data));
335333

336334
document.querySelectorAll('.ui.steps.phases .step, .runtime-step').forEach(node => node.addEventListener('click', el => {
337-
const phase = el.currentTarget.getAttribute('data-tab');
338-
renderCompareChartsForPhase(phase_stats.data, phase);
339-
}));
335+
const phase = el.currentTarget.getAttribute('data-tab');
336+
renderCompareChartsForPhase(phase_stats.data, phase);
337+
})
338+
);
339+
340+
renderCompareChartsForPhase(phase_stats.data, getAndShowPhase());
341+
displayTotalChart(...buildTotalChartData(phase_stats.data));
340342

341343
}
342344

0 commit comments

Comments
 (0)