From bd9a72920f90e69c08d4180652caaebf4bafc1e8 Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Thu, 10 May 2018 09:44:29 -0500 Subject: [PATCH] Delete tags before updating them in timeentry save --- model_timeentry.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model_timeentry.go b/model_timeentry.go index 0fcbb7d..dd3ef34 100644 --- a/model_timeentry.go +++ b/model_timeentry.go @@ -85,6 +85,8 @@ func (gdb *GimeDB) SaveTimeEntryType(tp int, te *TimeEntry) error { if err = useDb.SetTimestamp(tePath, "end", te.end); err != nil { return err } + // Remove all previously saved tags + useDb.DeleteBucket(tePath, "tags") for i := 0; i < te.tags.Length(); i++ { err = useDb.SetValue(append(tePath, "tags"), strconv.Itoa(i), te.tags.Get(i)) }