From 02cc8ed9b3b5c4f3c070abc769cd6f157ef2f23e Mon Sep 17 00:00:00 2001 From: Manohar Date: Fri, 19 Jun 2026 14:20:59 +0530 Subject: [PATCH] fix: make Analysis tab robust when no snapshot data exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - showView() now tracks _curView, scrolls to top, forces visibility - loadAnalysis() shows clear "No data yet" message when API returns null instead of silently leaving static placeholder text - forceRefreshAnalysis() added: POSTs /api/refresh then reloads analysis - ↻ Refresh button added at top of Analysis view with live timestamp - Auto-refresh analysis every 30s when Analysis tab is active Co-Authored-By: Claude Sonnet 4.6 --- public/index.html | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index 82e2d0c..5557550 100644 --- a/public/index.html +++ b/public/index.html @@ -302,6 +302,10 @@ ';}).join('');}} - var asofEl=document.getElementById('a-asof'); - if(asofEl&&asOf)asofEl.textContent='Updated: '+toIST(asOf); + var asofStr=asOf?'Updated: '+toIST(asOf):''; + var asofEl=document.getElementById('a-asof');if(asofEl)asofEl.textContent=asofStr; + var asofTop=document.getElementById('a-asof-top');if(asofTop)asofTop.textContent=asofStr; } /* ── End Analysis Tab ─────────────────────────────────────────────────── */ loadConfig();refresh(); setInterval(refresh,60000); setInterval(loadMarket,15000); +setInterval(function(){if(_curView==='analysis')loadAnalysis();},30000);