From 4b387457afb79dceb0971bc6052d45b1e2e16c87 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Tue, 24 Mar 2026 22:03:00 +0100 Subject: [PATCH] [fix](trx-frontend-http): show general bookmarks in scheduler bookmark selector Use the merged bookmarks endpoint instead of separate fetches so general bookmarks are always visible alongside rig-specific ones. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stan Grams --- .../assets/web/plugins/scheduler.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js index adee749..eaa10a6 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js @@ -106,19 +106,11 @@ } function apiGetBookmarks() { - // Fetch general bookmarks and rig-specific bookmarks, then merge. - // Rig-specific entries win on duplicate IDs. - var urls = ["/bookmarks"]; - if (currentRigId) urls.push("/bookmarks?scope=" + encodeURIComponent(currentRigId)); - return Promise.all(urls.map(function (u) { - return fetch(u).then(function (r) { return r.ok ? r.json() : []; }); - })).then(function (results) { - var byId = {}; - results.forEach(function (list) { - (Array.isArray(list) ? list : []).forEach(function (bm) { byId[bm.id] = bm; }); - }); - return Object.values(byId); - }); + // Fetch merged general + rig-specific bookmarks in a single request. + var url = currentRigId + ? "/bookmarks?scope=" + encodeURIComponent(currentRigId) + : "/bookmarks"; + return fetch(url).then(function (r) { return r.ok ? r.json() : []; }); } // -------------------------------------------------------------------------