From 5f411b9d77b372742d0966a34ca1b7b9a5367316 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Fri, 8 Mar 2024 23:09:53 +0100 Subject: [PATCH] Android:actTrk: fix find next nonsynced rec log --- apps/android/boot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/android/boot.js b/apps/android/boot.js index e1fb81d263..d0451b64ff 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); } gbSend({t:"actTrksList", list: recs}); // TODO: split up in multiple transmissions? },