From 8d42e4a1b2229be0bafe0ed378a49e4117cb2663 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sat, 6 Sep 2025 12:42:16 +0000 Subject: [PATCH] fix: resolve TypeScript type comparison errors in backup VMID handling --- frontend-modern/src/components/Backups/UnifiedBackups.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend-modern/src/components/Backups/UnifiedBackups.tsx b/frontend-modern/src/components/Backups/UnifiedBackups.tsx index 96db971dd..d4525d689 100644 --- a/frontend-modern/src/components/Backups/UnifiedBackups.tsx +++ b/frontend-modern/src/components/Backups/UnifiedBackups.tsx @@ -203,7 +203,8 @@ const UnifiedBackups: Component = () => { let displayType: GuestType; // Check for VMID=0 which indicates host backup (handle both string and number) - const isVmidZero = backup.vmid === '0' || backup.vmid === 0 || parseInt(String(backup.vmid)) === 0; + const vmidAsNumber = typeof backup.vmid === 'string' ? parseInt(backup.vmid, 10) : backup.vmid; + const isVmidZero = vmidAsNumber === 0; if (debugMode && isVmidZero) { console.log('[PMG Debug] PBS backup with VMID=0:', { @@ -277,7 +278,8 @@ const UnifiedBackups: Component = () => { let displayType: GuestType; // Check for VMID=0 which indicates host backup - const isVmidZero = backup.vmid === 0 || backup.vmid === '0' || parseInt(String(backup.vmid)) === 0; + const vmidAsNumber = typeof backup.vmid === 'string' ? parseInt(backup.vmid, 10) : backup.vmid; + const isVmidZero = vmidAsNumber === 0; if (debugMode && isVmidZero) { console.log('[PMG Debug] Storage backup with VMID=0:', {