()
| 5470 | const reindexedSources = new Set(); |
| 5471 | |
| 5472 | const updateStatus = () => { |
| 5473 | if (!searchEverywhereStatusEl) return; |
| 5474 | const ids = Object.keys(statusById); |
| 5475 | if (!ids.length) { |
| 5476 | searchEverywhereStatusEl.textContent = ''; |
| 5477 | return; |
| 5478 | } |
| 5479 | const doneCount = ids.filter(id => statusById[id] !== 'pending').length; |
| 5480 | const pendingLabels = ids.filter(id => statusById[id] === 'pending').map(id => labelById[id]).filter(Boolean); |
| 5481 | const failedLabels = ids.filter(id => statusById[id] === 'error').map(id => labelById[id]).filter(Boolean); |
| 5482 | |
| 5483 | if (doneCount >= ids.length && pendingLabels.length === 0) { |
| 5484 | if (failedLabels.length) { |
| 5485 | searchEverywhereStatusEl.textContent = `Failed: ${failedLabels.join(', ')}`; |
| 5486 | } else { |
| 5487 | searchEverywhereStatusEl.textContent = ''; |
| 5488 | } |
| 5489 | return; |
| 5490 | } |
| 5491 | |
| 5492 | let text = `${t("loading") || "Loading..."} (${doneCount}/${ids.length})`; |
| 5493 | if (pendingLabels.length) { |
| 5494 | text += ` - Waiting on: ${pendingLabels.join(', ')}`; |
| 5495 | } |
| 5496 | if (failedLabels.length) { |
| 5497 | text += ` - Failed: ${failedLabels.join(', ')}`; |
| 5498 | } |
| 5499 | searchEverywhereStatusEl.textContent = text; |
| 5500 | }; |
| 5501 | |
| 5502 | updateStatus(); |
| 5503 |
no test coverage detected