mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-08 03:08:02 +00:00
refac
This commit is contained in:
parent
e6b00a8905
commit
626fcff417
1 changed files with 13 additions and 9 deletions
|
|
@ -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) : [];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue