chore: only check if play is undefined

This commit is contained in:
Pim Hutting
2026-01-20 13:55:34 +01:00
parent a8f9965391
commit 883f0a95a6

View File

@@ -85,9 +85,8 @@ const useProgramStore = create<ProgramState>((set, get) => ({
const rootGoals = phase["goals"] as Record<string, unknown>[]; const rootGoals = phase["goals"] as Record<string, unknown>[];
const flatList: GoalWithDepth[] = []; const flatList: GoalWithDepth[] = [];
// Helper: Define this ONCE, outside the loop
const isGoal = (item: Record<string, unknown>) => { const isGoal = (item: Record<string, unknown>) => {
return item["plan"] !== undefined && item["plan"] !== null; return item["plan"] !== undefined;
}; };
// Recursive helper function // Recursive helper function