mulligan9 commited on
Commit
d67f510
Β·
1 Parent(s): 14d6453

debug: add console logs to trace loading failure

Browse files
Files changed (1) hide show
  1. index.html +6 -1
index.html CHANGED
@@ -927,6 +927,7 @@ function updateQuote(q, isDemo) {
927
  // ── Main load ────────────────────────────────────────────────────────────────
928
  async function load() {
929
  const { symbol, interval, outputSize, apiKey } = state;
 
930
  const loader = document.getElementById('loading-indicator');
931
  loader.classList.add('visible');
932
  loader.textContent = 'Loading…';
@@ -939,6 +940,8 @@ async function load() {
939
  fetchSeries(symbol, interval, outputSize, apiKey),
940
  fetchQuote(symbol, apiKey),
941
  ]);
 
 
942
 
943
  const errorEl = document.getElementById('chart-error');
944
  const errorMsg = document.getElementById('chart-error-msg');
@@ -966,8 +969,10 @@ function switchTab(name) {
966
  }
967
 
968
  document.addEventListener('DOMContentLoaded', () => {
 
 
969
  document.getElementById('api-key-input').value = state.apiKey;
970
- initCharts();
971
  load();
972
 
973
  // Symbol input
 
927
  // ── Main load ────────────────────────────────────────────────────────────────
928
  async function load() {
929
  const { symbol, interval, outputSize, apiKey } = state;
930
+ console.log('[TD] load() called', { symbol, interval, outputSize, apiKey });
931
  const loader = document.getElementById('loading-indicator');
932
  loader.classList.add('visible');
933
  loader.textContent = 'Loading…';
 
940
  fetchSeries(symbol, interval, outputSize, apiKey),
941
  fetchQuote(symbol, apiKey),
942
  ]);
943
+ console.log('[TD] series:', series?.data?.length, 'points, demo:', series?.demo, 'error:', series?.error);
944
+ console.log('[TD] quote:', quoteData?.q?.close, 'demo:', quoteData?.demo);
945
 
946
  const errorEl = document.getElementById('chart-error');
947
  const errorMsg = document.getElementById('chart-error-msg');
 
969
  }
970
 
971
  document.addEventListener('DOMContentLoaded', () => {
972
+ console.log('[TD] DOMContentLoaded');
973
+ console.log('[TD] LightweightCharts available:', typeof LightweightCharts);
974
  document.getElementById('api-key-input').value = state.apiKey;
975
+ try { initCharts(); console.log('[TD] initCharts OK'); } catch(e) { console.error('[TD] initCharts FAILED:', e); }
976
  load();
977
 
978
  // Symbol input