mirror of
https://github.com/open-webui/open-webui.git
synced 2026-04-28 03:28:30 -05:00
refac
This commit is contained in:
@@ -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) : [];
|
||||
|
||||
Reference in New Issue
Block a user