battery-minus

Pebble activity tracker that records battery events
git clone https://git.instinctive.eu/battery-minus.git
Log | Files | Refs | README | LICENSE

commit 497cca3f03cb44c1d60d7eec97d6ada9247d59bd
parent 4d6c78800029f0f524987b2989226bd5e7b0ac2f
Author: Natasha Kerensikova <natacha@instinctive.eu>
Date:   Thu, 26 May 2016 16:49:54 +0000

Fix storage of lastSent on phone side

For future reference, same as Pebble Health Export, data "sent" means
from watch to phone, while "uploaded" or "posted" means from phone to
webserver. So lastSent is the last recevied by phone from the watch,
which happens in `enqueue` (or processing the received message).
Diffstat:
Msrc/js/app.js | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/js/app.js b/src/js/app.js @@ -62,6 +62,7 @@ function sendHead() { function enqueue(key, line) { to_send.push(key + ";" + line); localStorage.setItem("toSend", to_send.join("|")); + localStorage.setItem("lastSent", key); if (to_send.length === 1) { sendHead(); } @@ -70,7 +71,6 @@ function enqueue(key, line) { function uploadDone() { var sent_key = to_send.shift().split(";")[0]; localStorage.setItem("toSend", to_send.join("|")); - localStorage.setItem("lastSent", sent_key); if (to_send.length === 0) { Pebble.sendAppMessage({ "lastPosted": parseInt(sent_key, 10) }); }