Skip to content

Commit

Permalink
Android:actTrk: fix find next nonsynced rec log
Browse files Browse the repository at this point in the history
  • Loading branch information
thyttan committed Mar 8, 2024
1 parent 8439681 commit 5f411b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/android/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@
"listRecs": function() {
let recs = require("Storage").list(/^recorder\.log.*\.csv$/,{sf:true}).map(s => s.slice(12, 21));
if (event.id.length > 2) { // Handle if there was no id supplied. Then we send a list all available recorder logs back.
recs = recs.slice(recs.indexOf(event.id)); // FIXME: Currently does not handle if the last fetched log was deleted on the watch, so that there won't be any entry corresponding to `event.id`
recs.shift();
let isFirstNonsyncedIdx = recs.findIndex((logId) => logId > event.id);
recs = recs.slice(isFirstNonsyncedIdx);
}
gbSend({t:"actTrksList", list: recs}); // TODO: split up in multiple transmissions?
},
Expand Down

0 comments on commit 5f411b9

Please sign in to comment.