This commit is contained in:
Timothy Jaeryang Baek
2026-03-07 17:06:30 -06:00
parent e6b00a8905
commit 626fcff417

View File

@@ -934,15 +934,19 @@
}
};
$: if (history) {
cancelAnimationFrame(contentsRAF);
contentsRAF = requestAnimationFrame(() => {
getContents();
contentsRAF = null;
});
} else {
artifactContents.set([]);
}
const onHistoryChange = (history) => {
if (history) {
cancelAnimationFrame(contentsRAF);
contentsRAF = requestAnimationFrame(() => {
getContents();
contentsRAF = null;
});
} else {
artifactContents.set([]);
}
};
$: onHistoryChange(history);
const getContents = () => {
const messages = history ? createMessagesList(history, history.currentId) : [];