Skip to content

Commit

Permalink
fix: cache operations ui
Browse files Browse the repository at this point in the history
  • Loading branch information
JivusAyrus committed Jan 15, 2025
1 parent ab3a286 commit 1c1caf4
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ const CacheOperationsPage: NextPageWithLayout = () => {
);
}

if (isLoading) {
return <Loader fullscreen />;
}

if (!data?.isCacheWarmerEnabled) {
return (
<EmptyState
Expand All @@ -141,10 +145,6 @@ const CacheOperationsPage: NextPageWithLayout = () => {
);
}

if (isLoading) {
return <Loader fullscreen />;
}

if (error || data?.response?.code !== EnumStatusCode.OK) {
return (
<EmptyState
Expand All @@ -165,9 +165,12 @@ const CacheOperationsPage: NextPageWithLayout = () => {
<div className="flex justify-end">
<div className="flex items-center gap-x-3">
{lastComputedAt && (
<p className="text-sm font-semibold text-muted-foreground">{`Last computed ${formatDistanceToNow(new Date(lastComputedAt), {
addSuffix: true,
})}`}</p>
<p className="text-sm font-semibold text-muted-foreground">{`Last computed ${formatDistanceToNow(
new Date(lastComputedAt),
{
addSuffix: true,
},
)}`}</p>
)}
<Button
variant="outline"
Expand Down

0 comments on commit 1c1caf4

Please sign in to comment.