clean up tech debt, bump dependencies

This commit is contained in:
Aiden McClelland
2025-08-15 18:32:27 -06:00
parent 7094d1d939
commit d06c443c7d
44 changed files with 120 additions and 126 deletions

View File

@@ -211,5 +211,5 @@ export class ServiceRoute {
function toHealthCheck(status: T.MainStatus): T.NamedHealthCheckResult[] {
return status.main !== 'running' || isEmptyObject(status.health)
? []
: Object.values(status.health)
: Object.values(status.health).filter(h => !!h)
}

View File

@@ -103,12 +103,14 @@ export class DepErrorService {
// action required
if (
Object.values(pkg.tasks).some(
t =>
t.active &&
t.task.packageId === depId &&
t.task.severity === 'critical',
)
Object.values(pkg.tasks)
.filter(t => !!t)
.some(
t =>
t.active &&
t.task.packageId === depId &&
t.task.severity === 'critical',
)
) {
return {
type: 'actionRequired',

View File

@@ -19,13 +19,13 @@ export class GatewayService {
.pipe(
map(gateways =>
Object.entries(gateways)
.filter(([_, val]) => !!val.ipInfo)
.filter(([_, val]) => !!val?.ipInfo)
.map(
([id, val]) =>
({
...val,
id,
lanIpv4: val.ipInfo?.subnets
lanIpv4: val?.ipInfo?.subnets
.filter(s => !s.includes('::'))
.map(s => s.split('/')[0]),
}) as GatewayPlus,

View File

@@ -25,9 +25,9 @@ export function getInstalledPrimaryStatus({
tasks,
status,
}: T.PackageDataEntry): PrimaryStatus {
return Object.values(tasks).some(
t => t.active && t.task.severity === 'critical',
)
return Object.values(tasks)
.filter(t => !!t)
.some(t => t.active && t.task.severity === 'critical')
? 'actionRequired'
: status.main
}
@@ -37,7 +37,7 @@ function getHealthStatus(status: T.MainStatus): T.HealthStatus | null {
return null
}
const values = Object.values(status.health)
const values = Object.values(status.health).filter(h => !!h)
if (values.some(h => h.result === 'failure')) {
return 'failure'