From 14a6a382d056bab534378c9f3544cdb2d1f756bd Mon Sep 17 00:00:00 2001 From: Maxime Cannoodt Date: Fri, 13 Aug 2021 14:06:49 +0200 Subject: [PATCH] patch 0.2.1 - fix undefined description for time entries with no desc - fix project summary list not updating after stopping a timer --- CHANGELOG.md | 7 +++++++ lib/ui/components/CurrentTimerDisplay.svelte | 14 +++++++++++++- lib/ui/components/TogglReportBarChart.svelte | 10 ++++++++-- lib/ui/components/TogglReportProjectList.svelte | 12 +++++++++--- manifest.json | 2 +- versions.json | 3 ++- 6 files changed, 40 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88b6f8e..731da78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.1] + +### 🐛 Fixes + +- Fix summary sidebar panel showing `undefined` when running a time entry with no description. +- Fix project summary list not updating after stopping a timer + ## [0.2.0] Hello! This release features a basic implementation of the Toggl Track summary view for the sidebar. diff --git a/lib/ui/components/CurrentTimerDisplay.svelte b/lib/ui/components/CurrentTimerDisplay.svelte index b4b1356..bc8fdf5 100644 --- a/lib/ui/components/CurrentTimerDisplay.svelte +++ b/lib/ui/components/CurrentTimerDisplay.svelte @@ -40,7 +40,13 @@ >
{#if timer} -
{timer.description}
+
+ {#if timer.description} + {timer.description} + {:else} + No description + {/if} +
import type Report from 'lib/model/Report'; import { dailySummary } from 'lib/util/stores'; + import { onDestroy } from 'svelte'; + + let list: { color: string; percentage: number }[]; const computeList = (r: Report) => { if (r == null) { @@ -24,8 +27,11 @@ return tmp_list; }; - let list: { color: string; percentage: number }[] = - computeList($dailySummary); + const unsubscribe = dailySummary.subscribe((val) => { + list = computeList(val); + }); + + onDestroy(unsubscribe);
diff --git a/lib/ui/components/TogglReportProjectList.svelte b/lib/ui/components/TogglReportProjectList.svelte index 1ff866f..9923b79 100644 --- a/lib/ui/components/TogglReportProjectList.svelte +++ b/lib/ui/components/TogglReportProjectList.svelte @@ -2,6 +2,9 @@ import type Report from 'lib/model/Report'; import millisecondsToTimeString from 'lib/util/millisecondsToTimeString'; import { dailySummary } from 'lib/util/stores'; + import { onDestroy } from 'svelte'; + + let list: { color: string; duration: string; name: string }[]; const computeList = (r: Report) => { if (r == null) { @@ -14,12 +17,15 @@ })); }; - let entries: { color: string; duration: string; name: string }[] = - computeList($dailySummary); + const unsubscribe = dailySummary.subscribe((val) => { + list = computeList(val); + }); + + onDestroy(unsubscribe);
- {#each entries as e, i} + {#each list as e, i}
diff --git a/manifest.json b/manifest.json index f254db5..49fdfcd 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-toggl-integration", "name": "Toggl Track", - "version": "0.2.0", + "version": "0.2.1", "minAppVersion": "0.11.13", "description": "This plugin provides features for starting, stopping, and managing timers using Toggl Track.", "author": "Maxime Cannoodt (@mcndt)", diff --git a/versions.json b/versions.json index ecd5cf4..712b692 100644 --- a/versions.json +++ b/versions.json @@ -2,5 +2,6 @@ "0.1.0": "0.11.13", "0.1.1": "0.11.13", "0.1.2": "0.11.13", - "0.2.0": "0.11.13" + "0.2.0": "0.11.13", + "0.2.1": "0.11.13" }