From 1d0220b03df95540d29de4649c4bedbdb57b85a0 Mon Sep 17 00:00:00 2001 From: azivner Date: Sat, 17 Feb 2018 10:45:00 -0500 Subject: [PATCH] add weight causes updating old chart instead of creating new chart, closes #53 --- src/scripts/weight.html | 158 ++++++++++++++++++++----------------- src/services/attributes.js | 4 + 2 files changed, 90 insertions(+), 72 deletions(-) diff --git a/src/scripts/weight.html b/src/scripts/weight.html index cac05a419..a00888999 100644 --- a/src/scripts/weight.html +++ b/src/scripts/weight.html @@ -16,84 +16,98 @@ \ No newline at end of file diff --git a/src/services/attributes.js b/src/services/attributes.js index 06322349c..a1c26b26e 100644 --- a/src/services/attributes.js +++ b/src/services/attributes.js @@ -53,6 +53,10 @@ async function getNoteIdsWithAttribute(name) { } async function createAttribute(noteId, name, value = "", sourceId = null) { + if (value === null || value === undefined) { + value = ""; + } + const now = utils.nowDate(); const attributeId = utils.newAttributeId();