This commit is contained in:
Timothy Jaeryang Baek
2026-03-07 17:06:30 -06:00
parent e6b00a8905
commit 626fcff417
+13 -9
View File
@@ -934,15 +934,19 @@
} }
}; };
$: if (history) { const onHistoryChange = (history) => {
cancelAnimationFrame(contentsRAF); if (history) {
contentsRAF = requestAnimationFrame(() => { cancelAnimationFrame(contentsRAF);
getContents(); contentsRAF = requestAnimationFrame(() => {
contentsRAF = null; getContents();
}); contentsRAF = null;
} else { });
artifactContents.set([]); } else {
} artifactContents.set([]);
}
};
$: onHistoryChange(history);
const getContents = () => { const getContents = () => {
const messages = history ? createMessagesList(history, history.currentId) : []; const messages = history ? createMessagesList(history, history.currentId) : [];