fix: handle malformed document lists in preparation overview
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user