Skip to content

Commit aa10eb9

Browse files
committed
Add back loading state for build list, for experimental toggling
1 parent a490aa8 commit aa10eb9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/data/SoftwareDownload.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@
5353
return `text-channel-${c}-primary`;
5454
}
5555
56+
let buildsLoading = $state(false);
5657
watch(
5758
() => version,
5859
(ver, oldVer) => {
5960
// Only handle changes, not initial page load where builds are prerendered on server.
6061
if (oldVer !== undefined && ver !== oldVer) {
62+
buildsLoading = true;
6163
fetchBuildsOrError({ value: project }, !isStable).then((result) => {
6264
builds = result;
65+
buildsLoading = false;
6366
});
6467
}
6568
}
@@ -142,7 +145,9 @@
142145
</span>
143146
</p>
144147

145-
{#if builds.error}
148+
{#if buildsLoading}
149+
<div class="text-center text-sm text-gray-400">Loading builds…</div>
150+
{:else if builds.error}
146151
<div class="text-center text-sm text-red-500">{builds.error}</div>
147152
{:else if builds.value && builds.value.builds && builds.value.builds.length > 0}
148153
<SoftwareBuilds project={id} {version} builds={builds.value.builds} eol={!!eol} />

0 commit comments

Comments
 (0)