From dddba981c00ded3f1fb95f79dcc3453579cbf053 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Mon, 5 Jan 2026 08:48:57 +0100 Subject: [PATCH] implemented bugfix: selecting times by project id broke layout Signed-off-by: Stephan Richter --- frontend/src/routes/time/Index.svelte | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/routes/time/Index.svelte b/frontend/src/routes/time/Index.svelte index aa50c7d..97d53c8 100644 --- a/frontend/src/routes/time/Index.svelte +++ b/frontend/src/routes/time/Index.svelte @@ -20,7 +20,7 @@ let projects = {}; let project_filter = $state(null); if (router.hasQueryParam('project')) project_filter = router.getQueryParam('project'); - let sortedTimes = $derived.by(() => Object.values(times).map(time => ({ + let sortedTimes = $derived.by(() => Object.values(times).filter(match_prj_filter).map(time => ({ ...time, start: display(time.start_time), end: display(time.end_time), @@ -52,6 +52,7 @@ } function calcYearMap(){ + console.log('calcYearMap called'); let result = { months : {}, years : {} @@ -123,7 +124,7 @@ function match_prj_filter(time){ if (!project_filter) return true; for (var tid of time.task_ids){ - if (project_filter == tasks[tid].project_id) return true; + if (tasks[tid] && project_filter == tasks[tid].project_id) return true; } return false; } @@ -258,7 +259,6 @@ {#each sortedTimes as time,line} - {#if match_prj_filter(time)} {#if timeMap.years[line]} toggleRange(time.start.substring(0,4))} title={time.start.substring(0,4)} > @@ -321,7 +321,6 @@ {/if} - {/if} {/each}