Spaces:
Paused
Paused
Liam Dyer
commited on
fix: tool error not updating in UI (#1203)
Browse files
src/lib/components/chat/ToolUpdate.svelte
CHANGED
|
@@ -17,7 +17,7 @@
|
|
| 17 |
export let loading: boolean = false;
|
| 18 |
|
| 19 |
const toolName = tool.find(isMessageToolCallUpdate)?.call.name;
|
| 20 |
-
|
| 21 |
$: toolDone = tool.some(isMessageToolResultUpdate);
|
| 22 |
|
| 23 |
const availableTools: ToolFront[] = $page.data.tools;
|
|
@@ -27,7 +27,7 @@
|
|
| 27 |
|
| 28 |
let isShowingLoadingBar = false;
|
| 29 |
onMount(() => {
|
| 30 |
-
if (!toolDone && loading && loadingBarEl) {
|
| 31 |
loadingBarEl.classList.remove("hidden");
|
| 32 |
isShowingLoadingBar = true;
|
| 33 |
animation = loadingBarEl.animate([{ width: "0%" }, { width: "calc(100%+1rem)" }], {
|
|
@@ -39,7 +39,7 @@
|
|
| 39 |
});
|
| 40 |
|
| 41 |
// go to 100% quickly if loading is done
|
| 42 |
-
$: (!loading || toolDone) &&
|
| 43 |
browser &&
|
| 44 |
loadingBarEl &&
|
| 45 |
isShowingLoadingBar &&
|
|
|
|
| 17 |
export let loading: boolean = false;
|
| 18 |
|
| 19 |
const toolName = tool.find(isMessageToolCallUpdate)?.call.name;
|
| 20 |
+
$: toolError = tool.some(isMessageToolErrorUpdate);
|
| 21 |
$: toolDone = tool.some(isMessageToolResultUpdate);
|
| 22 |
|
| 23 |
const availableTools: ToolFront[] = $page.data.tools;
|
|
|
|
| 27 |
|
| 28 |
let isShowingLoadingBar = false;
|
| 29 |
onMount(() => {
|
| 30 |
+
if (!toolError && !toolDone && loading && loadingBarEl) {
|
| 31 |
loadingBarEl.classList.remove("hidden");
|
| 32 |
isShowingLoadingBar = true;
|
| 33 |
animation = loadingBarEl.animate([{ width: "0%" }, { width: "calc(100%+1rem)" }], {
|
|
|
|
| 39 |
});
|
| 40 |
|
| 41 |
// go to 100% quickly if loading is done
|
| 42 |
+
$: (!loading || toolDone || toolError) &&
|
| 43 |
browser &&
|
| 44 |
loadingBarEl &&
|
| 45 |
isShowingLoadingBar &&
|