Delete tags before updating them in timeentry save

This commit is contained in:
Brian Buller 2018-05-10 09:44:29 -05:00
parent 2a2aea8641
commit bd9a72920f

View File

@ -85,6 +85,8 @@ func (gdb *GimeDB) SaveTimeEntryType(tp int, te *TimeEntry) error {
if err = useDb.SetTimestamp(tePath, "end", te.end); err != nil { if err = useDb.SetTimestamp(tePath, "end", te.end); err != nil {
return err return err
} }
// Remove all previously saved tags
useDb.DeleteBucket(tePath, "tags")
for i := 0; i < te.tags.Length(); i++ { for i := 0; i < te.tags.Length(); i++ {
err = useDb.SetValue(append(tePath, "tags"), strconv.Itoa(i), te.tags.Get(i)) err = useDb.SetValue(append(tePath, "tags"), strconv.Itoa(i), te.tags.Get(i))
} }