diff --git a/src/components/details/sources/helm-repository-details.tsx b/src/components/details/sources/helm-repository-details.tsx index 0a3bb48..42878ff 100644 --- a/src/components/details/sources/helm-repository-details.tsx +++ b/src/components/details/sources/helm-repository-details.tsx @@ -15,7 +15,7 @@ export class FluxCDHelmRepositoryDetails extends React.Component< return (
- {object.status?.conditions.find((s: any) => s.type === 'Ready').message} + {object.status?.conditions?.find((s: any) => s.type === 'Ready').message} diff --git a/src/utils.tsx b/src/utils.tsx index 994693d..4dd628a 100644 --- a/src/utils.tsx +++ b/src/utils.tsx @@ -133,7 +133,7 @@ export function getStatusText(obj: T): str case 'in-progress': return 'In Progress' default: - return 'unknown' + return 'Unknown' } } @@ -145,5 +145,6 @@ function getStatus(obj: T) { if (obj.spec.suspend) return 'suspended' if (obj.status?.conditions?.find((c: any) => c.type === 'Ready').status === 'True') return 'ready' if (obj.status?.conditions?.find((c: any) => c.type === 'Ready').status === 'False') return 'not-ready' - return 'in-progress' + if (obj.status?.conditions) return 'in-progress' + return '' }