add front page logs.
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
<script lang="ts">
|
||||
import EmptyList from "../components/EmptyList.svelte";
|
||||
import EmptyParentEntry from "../components/EmptyParentEntry.svelte";
|
||||
import GoalEntry from "../components/GoalEntry.svelte";
|
||||
import LogEntry from "../components/LogEntry.svelte";
|
||||
import ParentEntry from "../components/ParentEntry.svelte";
|
||||
import ProjectEntry from "../components/ProjectEntry.svelte";
|
||||
import RefreshSelection from "../components/RefreshSelection.svelte";
|
||||
import type { ProjectResult } from "../models/project";
|
||||
import { fpGoalStore } from "../stores/goal";
|
||||
import { fpLogStore } from "../stores/logs";
|
||||
import { fpProjectStore, fpProjectStore2 } from "../stores/project";
|
||||
import { fpTaskStore } from "../stores/tasks";
|
||||
import { endOfDay, startOfDay } from "../utils/time";
|
||||
|
||||
let fakeMap: {[projectId: string]: boolean} = {}
|
||||
let fakeProjects: ProjectResult[]
|
||||
@@ -47,6 +52,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$: {
|
||||
if ($fpLogStore.stale && !$fpLogStore.loading) {
|
||||
fpLogStore.load({
|
||||
maxTime: endOfDay(new Date()),
|
||||
minTime: startOfDay(new Date()),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
$: {
|
||||
const individualTasks = $fpTaskStore.tasks
|
||||
.filter(t => $fpProjectStore.projects.find(p => p.id === t.projectId) == null)
|
||||
@@ -94,6 +109,14 @@
|
||||
{#if !$fpGoalStore.loading && $fpGoalStore.goals.length === 0}
|
||||
<EmptyList icon="list" text="No goals." />
|
||||
{/if}
|
||||
{#if $fpLogStore.logs.length > 0}
|
||||
<h1>Today's Logs</h1>
|
||||
<EmptyParentEntry icon="list">
|
||||
{#each $fpLogStore.logs as log (log.id)}
|
||||
<LogEntry log={log} />
|
||||
{/each}
|
||||
</EmptyParentEntry>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="right">
|
||||
{#if $fpProjectStore.projects.length > 0}
|
||||
|
||||
Reference in New Issue
Block a user