()
| 451 | * entry so a second call is a no-op. |
| 452 | */ |
| 453 | export function removeLastFromHistory(): void { |
| 454 | if (!lastAddedEntry) return |
| 455 | const entry = lastAddedEntry |
| 456 | lastAddedEntry = null |
| 457 | |
| 458 | const idx = pendingEntries.lastIndexOf(entry) |
| 459 | if (idx !== -1) { |
| 460 | pendingEntries.splice(idx, 1) |
| 461 | } else { |
| 462 | skippedTimestamps.add(entry.timestamp) |
| 463 | } |
| 464 | } |
| 465 |