mirror of https://github.com/waku-org/waku-lab.git
chore: use async generator for store queries to improve load times
This commit is contained in:
parent
4be546db17
commit
29a9aa4d6f
|
@ -98,22 +98,6 @@ const ChainList: React.FC<ChainListProps> = ({ chainsData, onChainUpdate, isLoad
|
||||||
|
|
||||||
const rootBlocks = chainsData.filter(block => !block.parentBlockUUID);
|
const rootBlocks = chainsData.filter(block => !block.parentBlockUUID);
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return (
|
|
||||||
<Card className="w-full max-w-4xl mx-auto">
|
|
||||||
<CardHeader>
|
|
||||||
<CardTitle>Loading Chains</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<div className="flex flex-col items-center justify-center space-y-4 py-8">
|
|
||||||
<Loader2 className="h-8 w-8 animate-spin" />
|
|
||||||
<p className="text-muted-foreground">Fetching chains from the network...</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="w-full max-w-4xl mx-auto">
|
<Card className="w-full max-w-4xl mx-auto">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
|
@ -128,7 +112,7 @@ const ChainList: React.FC<ChainListProps> = ({ chainsData, onChainUpdate, isLoad
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
{rootBlocks.length === 0 ? (
|
{rootBlocks.length === 0 && !isLoading ? (
|
||||||
<p>No chains found.</p>
|
<p>No chains found.</p>
|
||||||
) : (
|
) : (
|
||||||
<ul className="space-y-4">
|
<ul className="space-y-4">
|
||||||
|
|
Loading…
Reference in New Issue