clean up
This commit is contained in:
parent
0301f24fd8
commit
b45e9dea29
@ -8,9 +8,7 @@ export function extractHistoryTree(
|
|||||||
|
|
||||||
let currentIndex: number | null = version;
|
let currentIndex: number | null = version;
|
||||||
while (currentIndex !== null) {
|
while (currentIndex !== null) {
|
||||||
// TODO: Handle currentIndex being out of bounds
|
|
||||||
const item: HistoryItem = history[currentIndex];
|
const item: HistoryItem = history[currentIndex];
|
||||||
console.log(item);
|
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
if (item.type === "ai_create") {
|
if (item.type === "ai_create") {
|
||||||
@ -24,6 +22,7 @@ export function extractHistoryTree(
|
|||||||
// Move to the parent of the current item
|
// Move to the parent of the current item
|
||||||
currentIndex = item.parentIndex;
|
currentIndex = item.parentIndex;
|
||||||
} else {
|
} else {
|
||||||
|
// TODO: Throw an exception here?
|
||||||
// Break the loop if the item is not found (should not happen in a well-formed history)
|
// Break the loop if the item is not found (should not happen in a well-formed history)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user