Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

refactor([issue-817]): drop redundant object guards before optional chaining in river throughput

[._.]/ Adam Eivy9a7171fb450f
diff --git a/client/src/components/city/CityTaskFlowRiver.jsx b/client/src/components/city/CityTaskFlowRiver.jsx
index 3d76200fdc..2f74604783 100644
--- a/client/src/components/city/CityTaskFlowRiver.jsx
+++ b/client/src/components/city/CityTaskFlowRiver.jsx
@@ -15,14 +15,10 @@ export default function CityTaskFlowRiver({ cosTasks, productivityData, calendar
const queue = computeTaskQueue(cosTasks);
// Recent throughput: prefer the calendar window total (steady multi-day signal), fall
// back to today's completed count from the quick-summary so the river still flows before
- // the calendar fetch lands.
- const calendarTotal = calendarData && typeof calendarData === 'object'
- ? calendarData?.summary?.totalTasks
- : undefined;
- const todayCompleted = productivityData && typeof productivityData === 'object'
- ? productivityData?.today?.completed
- : undefined;
- const throughput = typeof calendarTotal === 'number' ? calendarTotal : todayCompleted;
+ // the calendar fetch lands. Optional chaining tolerates missing/non-object payloads;
+ // computeTaskFlowRiver reads a non-number as zero.
+ const calendarTotal = calendarData?.summary?.totalTasks;
+ const throughput = typeof calendarTotal === 'number' ? calendarTotal : productivityData?.today?.completed;
return computeTaskFlowRiver(queue, throughput);
}, [cosTasks, productivityData, calendarData]);