diff --git a/apps/android/boot.js b/apps/android/boot.js index e1fb81d263..818fd60f92 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -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+1); } gbSend({t:"actTrksList", list: recs}); // TODO: split up in multiple transmissions? },