Spaces:
Running
Running
Update js/main.js
Browse files- js/main.js +5 -4
js/main.js
CHANGED
|
@@ -2,11 +2,13 @@ import { state } from './state.js';
|
|
| 2 |
import { initChart, getSeries } from './chart.js';
|
| 3 |
import { startSocket } from './socket.js';
|
| 4 |
import { toggleReplay, playReplay, step } from './replay.js';
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
async function initApp() {
|
| 8 |
initChart();
|
| 9 |
detectTimezone();
|
|
|
|
| 10 |
|
| 11 |
// Load Initial History (REST API)
|
| 12 |
const loader = document.getElementById('loader');
|
|
@@ -22,14 +24,13 @@ async function initApp() {
|
|
| 22 |
}));
|
| 23 |
|
| 24 |
getSeries().setData(state.candles);
|
| 25 |
-
loader.style.display = 'none';
|
| 26 |
|
| 27 |
-
// Start Socket
|
| 28 |
startSocket();
|
| 29 |
|
| 30 |
} catch(err) {
|
| 31 |
console.error(err);
|
| 32 |
-
loader.innerText = 'DATA LOAD ERROR';
|
| 33 |
}
|
| 34 |
}
|
| 35 |
|
|
|
|
| 2 |
import { initChart, getSeries } from './chart.js';
|
| 3 |
import { startSocket } from './socket.js';
|
| 4 |
import { toggleReplay, playReplay, step } from './replay.js';
|
| 5 |
+
// IMPORTANT: Import initFootprint
|
| 6 |
+
import { detectTimezone, initFootprint } from './ui.js';
|
| 7 |
|
| 8 |
async function initApp() {
|
| 9 |
initChart();
|
| 10 |
detectTimezone();
|
| 11 |
+
initFootprint(); // <--- ADD THIS LINE TO START THE DRAWING LOOP
|
| 12 |
|
| 13 |
// Load Initial History (REST API)
|
| 14 |
const loader = document.getElementById('loader');
|
|
|
|
| 24 |
}));
|
| 25 |
|
| 26 |
getSeries().setData(state.candles);
|
| 27 |
+
if(loader) loader.style.display = 'none';
|
| 28 |
|
|
|
|
| 29 |
startSocket();
|
| 30 |
|
| 31 |
} catch(err) {
|
| 32 |
console.error(err);
|
| 33 |
+
if(loader) loader.innerText = 'DATA LOAD ERROR';
|
| 34 |
}
|
| 35 |
}
|
| 36 |
|