fix: handle malformed document lists in preparation overview

This commit is contained in:
2026-09-06 16:23:14 +03:00
parent b5b3d75341
commit b49ae4c59f
4 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ function Overview({tenders,now}) {
useEffect(()=>{
let cancelled=false;
setVault({loading:true,error:null,documents:[]});
listDocuments().then(data=>{if(!cancelled)setVault({loading:false,error:null,documents:data.belgeler});})
listDocuments().then(data=>{if(!cancelled)setVault({loading:false,error:null,documents:Array.isArray(data?.belgeler) ? data.belgeler : []});})
.catch(error=>{if(!cancelled)setVault({loading:false,error:error.message,documents:[]});});
return()=>{cancelled=true;};
},[refresh]);