Stop showing indefinite backup spinner with no data
This commit is contained in:
parent
9fc7d9cbe1
commit
1d214a1c61
1 changed files with 10 additions and 8 deletions
|
|
@ -6,7 +6,15 @@ import UnifiedBackups from './UnifiedBackups';
|
||||||
import { ProxmoxSectionNav } from '@/components/Proxmox/ProxmoxSectionNav';
|
import { ProxmoxSectionNav } from '@/components/Proxmox/ProxmoxSectionNav';
|
||||||
|
|
||||||
const Backups: Component = () => {
|
const Backups: Component = () => {
|
||||||
const { state, connected } = useWebSocket();
|
const { state, connected, initialDataReceived } = useWebSocket();
|
||||||
|
|
||||||
|
const hasBackupData = () =>
|
||||||
|
Boolean(
|
||||||
|
state.backups?.pve?.guestSnapshots?.length ||
|
||||||
|
state.backups?.pve?.storageBackups?.length ||
|
||||||
|
state.backups?.pbs?.length ||
|
||||||
|
state.backups?.pmg?.length,
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="space-y-3">
|
<div class="space-y-3">
|
||||||
|
|
@ -14,13 +22,7 @@ const Backups: Component = () => {
|
||||||
|
|
||||||
{/* Loading State */}
|
{/* Loading State */}
|
||||||
<Show
|
<Show
|
||||||
when={
|
when={connected() && !initialDataReceived() && !hasBackupData()}
|
||||||
connected() &&
|
|
||||||
!(state.backups?.pve?.guestSnapshots?.length ||
|
|
||||||
state.backups?.pve?.storageBackups?.length ||
|
|
||||||
state.backups?.pbs?.length ||
|
|
||||||
state.backups?.pmg?.length)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<Card padding="lg">
|
<Card padding="lg">
|
||||||
<EmptyState
|
<EmptyState
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue