Feat: Use database data for pending items

This commit is contained in:
Simon Cordt
2025-09-26 18:09:11 +02:00
parent 2c16b807c0
commit d5d41309b7
+7
View File
@@ -26,6 +26,13 @@
state.error = null;
const index = new Map();
// Prefer db_by_id when available so running items also have DB info (renamed names)
if (queue?.db_by_id && typeof queue.db_by_id === 'object') {
Object.values(queue.db_by_id).forEach((row) => {
try { if (row?.prompt_id) index.set(String(row.prompt_id), row); } catch (err) { /* noop */ }
});
}
// Always include db_pending as well
state.db_pending.forEach((row) => {
if (row?.prompt_id) index.set(String(row.prompt_id), row);
});