From b13ce68fef3ba4aba280d804fafe9ae84082bf6c Mon Sep 17 00:00:00 2001 From: ramseshk <45832522+ramseshk@users.noreply.github.com> Date: Fri, 7 Aug 2026 14:17:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20inverted=20condition=20in=20loadResults?= =?UTF-8?q?=20=E2=80=94=20new=20API=20response=20format=20was=20falling=20?= =?UTF-8?q?into=20wrong=20branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/static/vbt.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dashboard/static/vbt.html b/dashboard/static/vbt.html index c1a1b19..3ab86f9 100644 --- a/dashboard/static/vbt.html +++ b/dashboard/static/vbt.html @@ -177,11 +177,12 @@ async function loadResults(){ document.getElementById('results-list').innerHTML='
Loading...
'; try{ const resp=await fetch(buildUrl());const data=await resp.json(); - if(!data||!Array.isArray(data.results)){ - const results=data.results||[];const total=data.total||results.length;const hasMore=data.has_more??false; - renderResultsList(results,total,hasMore); - }else{ + if(data&&Array.isArray(data.results)){ + renderResultsList(data.results,data.total||0,data.has_more??false); + }else if(Array.isArray(data)){ renderResultsList(data,data.length,false); + }else{ + throw new Error('Unexpected response'); } }catch(e){document.getElementById('results-list').innerHTML='
Failed to load results
'+e+'
';} }